CSharp.OpenSource.LinqToKql
1.3.1
dotnet add package CSharp.OpenSource.LinqToKql --version 1.3.1
NuGet\Install-Package CSharp.OpenSource.LinqToKql -Version 1.3.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CSharp.OpenSource.LinqToKql" Version="1.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CSharp.OpenSource.LinqToKql --version 1.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: CSharp.OpenSource.LinqToKql, 1.3.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CSharp.OpenSource.LinqToKql as a Cake Addin #addin nuget:?package=CSharp.OpenSource.LinqToKql&version=1.3.1 // Install CSharp.OpenSource.LinqToKql as a Cake Tool #tool nuget:?package=CSharp.OpenSource.LinqToKql&version=1.3.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CSharp.OpenSource.LinqToKql
Example of using ORMGenerator
Generate
var providerExecutor = _mockExecutor.Object;
var ormGenerator = new ORMGenerator(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 = new List<ORMGeneratorDatabaseConfig>
{
new ORMGeneratorDatabaseConfig
{
DatabaseName = DbName1,
Filters = new ORMGeneratorFilterConfig()
},
new ORMGeneratorDatabaseConfig
{
DatabaseName = DbName2,
DatabaseDisplayName = "db2",
Filters = new ORMGeneratorFilterConfig()
}
}
});
await _ormGenerator.GenerateAsync();
// output example https://github.com/csharp-opensource/CSharp.OpenSource.LinqToKql/tree/master/Samples/ORMGeneratorTest
Usage
using AutoGen;
using CSharp.OpenSource.LinqToKql.Extensions;
using CSharp.OpenSource.LinqToKql.Http;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
services.AddKustoDbContext<AutoGenORMKustoDbContext, KustoHttpClient>(sp => new KustoHttpClient("mycluster", "auth", "dbName"));
var provider = services.BuildServiceProvider();
var dbContext = provider.GetRequiredService<AutoGenORMKustoDbContext>();
dbContext.TestTable1.Where(x => x.TestColumn == "test").ToList();
dbContext.db2<object>("customQuery").ToList();
dbContext.func1().ToList();
dbContext.func2("name", "lastName").ToList();
Example of using KustoDbContext
public interface IMyMultiDbContext : IKustoDbContext
{
IQueryable<SampleObject> SampleObjects { get; }
IQueryable<SampleObject2> SampleObjects2 { get; }
IQueryable<SampleObject> Func(int minYear);
IQueryable<SampleObject> Func2(int minYear);
IQueryable<SampleObject> Func3(int minYear);
}
public class MyMultiDbContext : KustoDbContext, IMyMultiDbContext
{
public MyMultiDbContext(IKustoDbContextExecutor<MyMultiDbContext> executor) : base(executor)
{
}
// from default db
public IQueryable<SampleObject> SampleObjects
=> CreateQuery<SampleObject>("sampleObjects");
// from different db
public IQueryable<SampleObject2> SampleObjects2
=> CreateQuery<SampleObject2>("sampleObjects2", database: "diffDb");
public IQueryable<SampleObject> Func(int minYear)
=> CreateQuery<SampleObject>($"sampleObjects | where year > {minYear}");
public IQueryable<SampleObject> Func2(int minYear)
=> CreateQuery<SampleObject>($"sampleObjectsByMinYear({minYear})");
public IQueryable<SampleObject> Func3(int minYear)
=> SampleObjects.Where(x => x.Year > minYear);
protected override LinqToKQLQueryTranslatorConfig GetConfig() => new() { DisableNestedProjection = true };
}
Example of using KustoHttpClientLinqProviderFactory
using CSharp.OpenSource.LinqToKql.Http;
using CSharp.OpenSource.LinqToKql.Test.Model;
namespace CSharp.OpenSource.LinqToKql.Test.Provider;
public class SampleKustoHttpClientLinqProviderFactory : KustoHttpClientLinqProviderFactory
{
private string _cluster = "https://myclusterUrl/";
private string _auth = "myBearerToken";
private string _defaultDbName = "myDatabaseName";
public IQueryable<SampleObject> SampleObject
=> CreateQuery<SampleObject>(_cluster, _auth, _defaultDbName, "SampleObjectTable");
public IQueryable<SampleObject> SampleObjectFunction(long number)
=> CreateQuery<SampleObject>(_cluster, _auth, _defaultDbName, $"SampleObjectFunction({number})");
public IQueryable<SampleObject2> SampleObject2(long number)
=> CreateQuery<SampleObject2>(_cluster, _auth, _defaultDbName, $"SampleObject2Table");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.1)
-
net7.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.1)
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.1 | 34 | 1/27/2025 |
1.3.0 | 58 | 1/22/2025 |
1.2.9 | 34 | 1/22/2025 |
1.2.8 | 44 | 1/22/2025 |
1.2.7 | 75 | 1/21/2025 |
1.2.6 | 132 | 1/6/2025 |
1.2.5 | 84 | 1/6/2025 |
1.2.4 | 268 | 12/19/2024 |
1.2.3 | 90 | 12/19/2024 |
1.2.2 | 84 | 12/18/2024 |
1.2.1 | 85 | 12/18/2024 |
1.2.0 | 86 | 12/17/2024 |
1.1.9 | 82 | 12/17/2024 |
1.1.8 | 79 | 12/17/2024 |
1.1.7 | 81 | 12/17/2024 |
1.1.6 | 84 | 12/17/2024 |
1.1.5 | 77 | 12/17/2024 |
1.1.4 | 97 | 12/14/2024 |
1.1.3 | 76 | 12/14/2024 |
1.1.2 | 334 | 12/8/2024 |
1.1.1 | 87 | 12/8/2024 |
1.1.0 | 81 | 12/8/2024 |
1.0.37 | 81 | 12/8/2024 |
1.0.35 | 87 | 12/5/2024 |
1.0.34 | 176 | 12/2/2024 |
1.0.33 | 76 | 12/2/2024 |
1.0.32 | 80 | 12/2/2024 |
1.0.31 | 81 | 12/2/2024 |
1.0.30 | 88 | 12/2/2024 |
1.0.29 | 84 | 12/2/2024 |
1.0.28 | 89 | 12/1/2024 |
1.0.25 | 84 | 12/1/2024 |
1.0.24 | 88 | 11/29/2024 |
1.0.23 | 78 | 11/29/2024 |
1.0.22 | 162 | 11/27/2024 |
1.0.21 | 77 | 11/27/2024 |
1.0.20 | 78 | 11/27/2024 |
1.0.19 | 118 | 11/27/2024 |
1.0.18 | 84 | 11/26/2024 |
1.0.17 | 93 | 11/24/2024 |
1.0.16 | 83 | 11/24/2024 |
1.0.15 | 83 | 11/18/2024 |
1.0.14 | 81 | 11/18/2024 |
1.0.13 | 78 | 11/18/2024 |
1.0.12 | 78 | 11/18/2024 |
1.0.11 | 84 | 11/18/2024 |
1.0.10 | 81 | 11/18/2024 |
1.0.9 | 80 | 11/18/2024 |
1.0.8 | 78 | 11/17/2024 |
1.0.7 | 81 | 11/17/2024 |
1.0.6 | 82 | 11/17/2024 |
1.0.5 | 80 | 11/17/2024 |
1.0.4 | 85 | 11/17/2024 |
1.0.3 | 90 | 11/17/2024 |
1.0.2 | 86 | 11/17/2024 |
1.0.1 | 87 | 11/17/2024 |
1.0.0 | 94 | 11/17/2024 |
0.0.1 | 86 | 11/17/2024 |