News

08-07-2024 More demo features
PRO TIP: Please log in to unlock MORE DEMO FEATURES!

29-06-2024 TrekkiCon an interstellar success!
The annually held TrekkiCon convention was once again a great and fun-filled success.

26-06-2024 The site is live!
This is the the first bulletin board message ever!


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
      ...Trekkitopia.Controllers.HomeController.Index:
      [HttpGet]
      public ViewResult Index()
      {
          var traceTree = _traceTreesRepository.Record();
          traceTree.RecordCodeMethodExecution(MethodBase.GetCurrentMethod());
      
          var bulletinModels = _bulletinService
              .GetLatestBulletins(_latestBulletinsCount, traceTree)
              .Select(_bulletinMapper.Convert);
      
          return View(new IndexModel(bulletinModels, _traceTreesRepository.RootTraceTree));
      }
    • Trace Entries: 2
        ...Trekkitopia.Business.BulletinService.GetLatestBulletins:
        public IEnumerable<Bulletin> GetLatestBulletins(int count, TraceTree parentTraceTree)
        {
            var traceTree = parentTraceTree.AddChild();
            traceTree.RecordCodeMethodExecution(MethodBase.GetCurrentMethod());
        
            var bulletinTable = new BulletinTable();
        
            Select select = new /*WYSE*/Select()
                .Columns(bulletinTable)
                .From(bulletinTable)
                .OrderBy(bulletinTable.When, OrderDirection.Desc)
                .Limit(count);
        
            return _sqlExecuter.GetItems(select, bulletinTable.Convert, traceTree);
        }
      • Trace Entries: 2
          ...Trekkitopia.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());
          
              return Get<IReadOnlyList<TItem>>(
                  select,
                  reader => reader./*WYSE*/GetItems(select, converter).ToList(),
                  traceTree);
          }
        • Trace Entries: 2
            ...Trekkitopia.DatabaseAccess.SqlExecuter.Get:
            private TItem Get<TItem>(
                /*WYSE*/IExecutable executable,
                Func<DbDataReader, TItem> getResult,
                TraceTree parentTraceTree)
            {
                var traceTree = parentTraceTree.AddChild();
                traceTree.RecordCodeMethodExecution(MethodBase.GetCurrentMethod());
            
                using MySqlConnection 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(executable);
            
                using MySqlCommand command = connection.CreateCommand()
                    // A WYSE Render context determines certain (overridable) render settings.
                    // Here the context is MySql. More SQL flavors are supported.
                    // A WYSE render builder is used for stringifying
                    // the strongly typed SQL statements.
                    /*WYSE*/.For(executable, _renderContextFactory.Create(), _createRenderBuilder);
            
                try
                {
                    using DbDataReader reader = command.ExecuteReader();
            
                    var result = getResult(reader);
            
                    traceTree.RecordDbCommandExecutionSuccess(
                        command.CommandText,
                        command.Parameters.ToDictionary(),
                        result);
            
                    return result;
                }
                catch (Exception exception)
                {
                    traceTree.RecordDbCommandExecutionFailure(
                        command.CommandText,
                        command.Parameters.ToDictionary(),
                        exception);
            
                    return default;
                }
            }

            Command Text:

            SELECT
                `bulletin`.`id` `bulletin_id`,
                `bulletin`.`when` `bulletin_when`,
                `bulletin`.`title` `bulletin_title`,
                `bulletin`.`text` `bulletin_text`
            FROM `bulletin` `bulletin`
            ORDER BY `bulletin`.`when` DESC LIMIT 10

Command Text:

SELECT
    `bulletin`.`id` `bulletin_id`,
    `bulletin`.`when` `bulletin_when`,
    `bulletin`.`title` `bulletin_title`,
    `bulletin`.`text` `bulletin_text`
FROM `bulletin` `bulletin`
ORDER BY `bulletin`.`when` DESC LIMIT 10