private static void ExecuteTphQueries(ILoggerFactory loggerFactory, ILogger logger) { using var ctx = GetTphContext(loggerFactory); SeedData(ctx, loggerFactory); logger.LogInformation(" ==== {caption} ====", nameof(Tph_Queries)); var demos = new Tph_Queries(ctx, logger); demos.FetchCustomers(); demos.FetchEmployees(); }
private static void ExecuteTphQueries(ILoggerFactory loggerFactory, ILogger logger) { using (var ctx = GetTphContext(loggerFactory)) { ctx.Database.Migrate(); if (!ctx.People.Any()) { ctx.SeedData(); } logger.LogInformation(" ==== {caption} ====", nameof(Tph_Queries)); var demos = new Tph_Queries(ctx, logger); demos.FetchCustomers(); demos.FetchEmployees(); } }