Tables Content

Below you can view the contents of all the tables used in this Report Generator demo.

FirstName LastName City DateOfBirth IsPreferred HomeAddressId BillingAddressId Id
John1 Doe1 2000-01-01 False 1 2 1
John2 Doe2 1980-06-06 True 3 4 2

City ZipCode Street HouseNumber HouseNumberAddition Id
City1H ZipCode1H Street1H 1 H 1
City1B ZipCode1B Street1B 2 B 2
City2H ZipCode2H Street2H 3 H 3
City2B ZipCode2B Street2B 4 B 4

CustomerId ProductId Quantity Date DeliveryAddressId Id
1 1 1 2020-08-10 1 1
1 2 2 2024-07-01 2 2
2 2 3 2019-03-14 3 3
2 3 7 2022-05-12 3 4
2 3 2 2024-09-08 4 5

Name Id
Product1 1
Product2 2
Product3 3

ProductId From UpTo Price
1 2018-01-01 2022-01-01 20
1 2022-01-01 25
2 2020-01-01 2023-01-01 30
2 2022-01-01 32
3 2021-01-01 2024-01-01 50
3 2024-01-01 60

The small window you are using greatly diminishes your demo experience. Please consider viewing using a larger window.

Behind The Scenes Explanation

This is where you get to see what's happening behind the scenes when you interact with the site on the left side.

The view consists of three (collapsible) parts...

1. Full Code, Queries, And Results

The server handles the web requests that are the result of you interacting with the site.
In doing so, the demo backend code is executed which in turn uses WYSE.

The relevant/notable methods taking part in that process are shown in the first vertical tab.
Basically you are seeing a (partial) stack trace.
It is tree structure of which the nodes are collapsible/expandable for your browsing convenience.

The leaves of the STACK TRACE TREE are where interaction with the database takes place.
That is generally where you will find the generated SQL statements and the JSON of the converted database results.

2. Queries And Results Only

A filtered list of entries where only the database queries and results are shown.

3. API Results

If applicable: this shows the JSON of the call to the server as if it had been an API call.

  • Trace Entries: 2
      ...ReportGenerator.Controllers.HomeController.TablesContent:
      [HttpGet]
      public ViewResult TablesContent()
      {
          var traceTree = _traceTreesRepository.Record();
          traceTree.RecordCodeMethodExecution(MethodBase.GetCurrentMethod());
      
          var customers = _tableContentRepository.GetItems<CustomerTable, Customer>(traceTree);
          // Tracing disabled for other tables to keep it concise.
          var addresses = _tableContentRepository.GetItems<AddressTable, Address>(null);
          var purchases = _tableContentRepository.GetItems<PurchaseTable, Purchase>(null);
          var products = _tableContentRepository.GetItems<ProductTable, Demos.ReportGenerator.Domain.Product>(null);
          var productPriceHistories = _tableContentRepository.GetItems<ProductPriceHistoryTable, ProductPriceHistory>(null);
      
          var contentModel = new TablesContentModel(
              _traceTreesRepository.RootTraceTree,
              customers,
              addresses,
              purchases,
              products,
              productPriceHistories);
      
          return View(contentModel);
      }
    • Trace Entries: 2
        ...ReportGenerator.Services.TableContentRepository.GetItems:
        public IReadOnlyList<TItem> GetItems<TTable, TItem>(TraceTree parentTraceTree)
            where TTable : ITable, IDbDataReaderConvert<TItem>, new()
        {
            var traceTree = parentTraceTree?.AddChild();
            traceTree?.RecordCodeMethodExecution(MethodBase.GetCurrentMethod());
        
            var table = new TTable();
        
            var select = SelectBuilder.Build(table);
        
            return _sqlExecuter.GetItems(select, table.Convert, traceTree);
        }
      • Trace Entries: 2
          ...ReportGenerator.DatabaseAccess.SqlExecuter.GetItems:
          public IReadOnlyList<TItem> GetItems<TItem>(
              /*WYSE*/ISelect select,
              Converter<DbDataReader, TItem> converter,
              TraceTree parentTraceTree)
          {
              var traceTree = parentTraceTree?.AddChild();
              traceTree?.RecordCodeMethodExecution(MethodBase.GetCurrentMethod());
          
              using SqlConnection connection = _connectionFactory.Create();
              connection.Open();
          
              // Aliases and parameter names can be given custom values.
              // If omitted, unique identifer values are supplied
              // In the case of this Demo, these generated values are overwritten,
              // based on the current render settings, with more legible values.
              // WYSE supports several kinds of Resetting/renaming.
              ResetIdentifiers(select);
          
              using SqlCommand command = connection.CreateCommand()
                  // A WYSE Render context determines certain (overridable) render settings.
                  // Here the context is SqlServer. More SQL flavors are supported.
                  // A WYSE render builder is used for stringifying
                  // the strongly typed SQL statements.
                  /*WYSE*/.For(select, _renderContextFactory.Create(), _createRenderBuilder);
          
              try
              {
                  using DbDataReader reader = command.ExecuteReader();
          
                  var items = reader.GetItems(select, converter).ToList();
          
                  traceTree?.RecordDbCommandExecutionSuccess(command.CommandText, items);
          
                  return items;
              }
              catch (Exception exception)
              {
                  traceTree?.RecordDbCommandExecutionFailure(command.CommandText, exception);
          
                  return default;
              }
          }

          Command Text:

          SELECT
              [Customer].[Id] [Customer_Id],
              [Customer].[FirstName] [Customer_FirstName],
              [Customer].[LastName] [Customer_LastName],
              [Customer].[DateOfBirth] [Customer_DateOfBirth],
              [Customer].[IsPreferred] [Customer_IsPreferred],
              [Customer].[HomeAddressId] [Customer_HomeAddressId],
              [Customer].[BillingAddressId] [Customer_BillingAddressId]
          FROM [Customer] [Customer]

Command Text:

SELECT
    [Customer].[Id] [Customer_Id],
    [Customer].[FirstName] [Customer_FirstName],
    [Customer].[LastName] [Customer_LastName],
    [Customer].[DateOfBirth] [Customer_DateOfBirth],
    [Customer].[IsPreferred] [Customer_IsPreferred],
    [Customer].[HomeAddressId] [Customer_HomeAddressId],
    [Customer].[BillingAddressId] [Customer_BillingAddressId]
FROM [Customer] [Customer]