src/Queryology.Example/Program.cs
ο»Ώusing ByteDecoder.Queryology.Example.Models;
using ByteDecoder.Queryology.Providers.ObjectDumper;
namespace ByteDecoder.Queryology.Example;
internal static class Program
{
internal static void Main()
{
// Using an EF Core provider
using var dbContext = new EfCoreContext();
var totalQueries = new QueryologyEngineBuilder<EfCoreContext>()
.Configure(options => options.DataContextProvider = dbContext)
.AddObjectDumper()
.Build()
.Execute();
Console.WriteLine($"\nπ¦π¦ Total Queries allowed to be executed by QueryologyEngine<EfCoreContext>: {totalQueries}");
Console.WriteLine("π΅π΅ Press Enter to continue... π΅π΅");
Console.ReadLine();
// Only to work with LINQ to Objects
using var nullDbContext = new NullDbContext();
totalQueries = new QueryologyEngineBuilder<NullDbContext>()
.Configure(options => options.DataContextProvider = nullDbContext)
.AddObjectDumper()
.Build()
.Execute();
Console.WriteLine($"\nπ¦π¦ Total Queries allowed to be executed by QueryologyEngine<NullDbContext>: {totalQueries}");
Console.WriteLine("π΅π΅ Press Enter to continue... π΅π΅");
Console.ReadLine();
}
}