You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varproviderExecutor=_mockExecutor.Object;varormGenerator=newORMGenerator(new(){ProviderExecutor=providerExecutor,ModelsFolderPath="../../../../ORMGeneratorTests/Models",DbContextFolderPath="../../../../ORMGeneratorTests",DbContextName="AutoGenORMKustoDbContext",Namespace="AutoGen",ModelsNamespace="AutoGen",DbContextNamespace="AutoGen",CreateDbContext=true,CleanFolderBeforeCreate=true,EnableNullable=true,FileScopedNamespaces=true,DatabaseConfigs=newList<ORMGeneratorDatabaseConfig>{newORMGeneratorDatabaseConfig{DatabaseName=DbName1,Filters=newORMGeneratorFilterConfig()},newORMGeneratorDatabaseConfig{DatabaseName=DbName2,DatabaseDisplayName="db2",Filters=newORMGeneratorFilterConfig()}}});await_ormGenerator.GenerateAsync();// output example https://github.com/csharp-opensource/CSharp.OpenSource.LinqToKql/tree/master/Samples/ORMGeneratorTest
publicinterfaceIMyMultiDbContext:IKustoDbContext{IQueryable<SampleObject>SampleObjects{get;}IQueryable<SampleObject2>SampleObjects2{get;}IQueryable<SampleObject>Func(intminYear);IQueryable<SampleObject>Func2(intminYear);IQueryable<SampleObject>Func3(intminYear);}publicclassMyMultiDbContext:KustoDbContext,IMyMultiDbContext{publicMyMultiDbContext(IKustoDbContextExecutor<MyMultiDbContext>executor):base(executor){}// from default dbpublicIQueryable<SampleObject>SampleObjects=>CreateQuery<SampleObject>("sampleObjects");// from different dbpublicIQueryable<SampleObject2>SampleObjects2=>CreateQuery<SampleObject2>("sampleObjects2",database:"diffDb");publicIQueryable<SampleObject>Func(intminYear)=>CreateQuery<SampleObject>($"sampleObjects | where year > {minYear}");publicIQueryable<SampleObject>Func2(intminYear)=>CreateQuery<SampleObject>($"sampleObjectsByMinYear({minYear})");publicIQueryable<SampleObject>Func3(intminYear)=>SampleObjects.Where(x =>x.Year>minYear);protectedoverrideLinqToKQLQueryTranslatorConfigGetConfig()=>new(){DisableNestedProjection=true};}
Example of using KustoHttpClientLinqProviderFactory