-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (29 loc) · 1.33 KB
/
Program.cs
File metadata and controls
35 lines (29 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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();
}
}