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]