![]() |
VOOZH | about |
dotnet add package TabuLynx.Core --version 0.7.0
NuGet\Install-Package TabuLynx.Core -Version 0.7.0
<PackageReference Include="TabuLynx.Core" Version="0.7.0" />
<PackageVersion Include="TabuLynx.Core" Version="0.7.0" />Directory.Packages.props
<PackageReference Include="TabuLynx.Core" />Project file
paket add TabuLynx.Core --version 0.7.0
#r "nuget: TabuLynx.Core, 0.7.0"
#:package TabuLynx.Core@0.7.0
#addin nuget:?package=TabuLynx.Core&version=0.7.0Install as a Cake Addin
#tool nuget:?package=TabuLynx.Core&version=0.7.0Install as a Cake Tool
The foundational library for the TabuLynx ecosystem, providing core abstractions, interfaces, and utilities for building applications that interact with Analysis Services Tabular Models, Power BI datasets, SSAS, and Microsoft Fabric.
IQueryExecutor, IConnection) for building TabuLynx applicationsTabuLynxOptions for connection settingsTabuLynxHostdotnet add package TabuLynx.Core
This package provides foundational functionality and depends on:
Note: TabuLynx.Core provides the foundation that other TabuLynx packages build upon. You'll typically use this alongside packages like
TabuLynx.Query.ExecutororTabuLynx.Model.Extractor.
appsettings.json:
{
"TabuLynx": {
"ConnectionString": "Provider=MSOLAP;Data Source=localhost:12345;"
}
}
Console Application:
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using TabuLynx.Core.Configuration;
using TabuLynx.Core.Interfaces;
using TabuLynx.Core.Connection;
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
var services = new ServiceCollection();
// Configure TabuLynx options
services.Configure<TabuLynxOptions>(configuration.GetSection("TabuLynx"));
// Register core services
services.AddSingleton<IConnection, TabuLynxConnection>();
var serviceProvider = services.BuildServiceProvider();
// Use the connection
var connection = serviceProvider.GetRequiredService<IConnection>();
Console.WriteLine($"Connection: {connection.ConnectionString}");
using TabuLynx.Core.Hosting;
using TabuLynx.Core.Interfaces;
using Microsoft.Extensions.DependencyInjection;
var host = TabuLynxHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(config =>
{
config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
})
.ConfigureServices((context, services) =>
{
// TabuLynxOptions are automatically configured and validated
services.AddSingleton<IConnection, TabuLynxConnection>();
// Add other TabuLynx services here
// services.AddAdomdQueryExecutorForLocalPowerBI();
// services.AddDmvModelExtractor();
})
.Build();
var connection = host.Services.GetRequiredService<IConnection>();
using TabuLynx.Core.Configuration;
using TabuLynx.Core.Interfaces;
using TabuLynx.Core.Connection;
var builder = WebApplication.CreateBuilder(args);
// Configure TabuLynx
builder.Services.Configure<TabuLynxOptions>(
builder.Configuration.GetSection("TabuLynx"));
// Register core services
builder.Services.AddSingleton<IConnection, TabuLynxConnection>();
var app = builder.Build();
app.MapGet("/connection", (IConnection connection) =>
{
return Results.Ok(new
{
HasConnectionString = !string.IsNullOrEmpty(connection.ConnectionString),
HasTenantId = !string.IsNullOrEmpty(connection.TenantId),
HasClientId = !string.IsNullOrEmpty(connection.ClientId)
});
});
app.Run();
The TabuLynxOptions class supports comprehensive configuration for different scenarios:
| Property | Description | Required | Default | Example |
|---|---|---|---|---|
ConnectionString |
XMLA/ADOMD connection string | Yes | - | Provider=MSOLAP;Data Source=localhost:{port}; |
TenantId |
Azure AD tenant ID | For cloud scenarios | "" |
12345678-1234-1234-1234-123456789012 |
ClientId |
Azure AD application client ID | For cloud scenarios | "" |
87654321-4321-4321-4321-210987654321 |
ClientSecret |
Azure AD application secret | For cloud scenarios | "" |
your-client-secret |
Scope |
OAuth scope for authentication | No | https://analysis.windows.net/powerbi/api/.default |
Custom scope if needed |
Local Power BI Desktop:
{
"TabuLynx": {
"ConnectionString": "Provider=MSOLAP;Data Source=localhost:{port};"
}
}
SSAS Server with Windows Authentication:
{
"TabuLynx": {
"ConnectionString": "Provider=MSOLAP;Data Source=your-server;Initial Catalog=your-database;Integrated Security=SSPI;"
}
}
Microsoft Fabric / Power BI Premium:
{
"TabuLynx": {
"ConnectionString": "Provider=MSOLAP;Data Source=powerbi://api.powerbi.com/v1.0/myorg/your-workspace;Initial Catalog=your-dataset;",
"TenantId": "your-tenant-id",
"ClientId": "your-app-client-id",
"ClientSecret": "your-app-client-secret"
}
}
Defines the contract for executing queries against Analysis Services:
public interface IQueryExecutor
{
Task<string> ExecuteQueryAsync(string query);
Task<List<Dictionary<string, object>>> ExecuteQueryWithDictionaryResultsAsync(string query);
}
Usage:
// Implemented by TabuLynx.Query.Executor package
var result = await queryExecutor.ExecuteQueryAsync("EVALUATE ROW(\"Hello\", \"World\")");
var dictResults = await queryExecutor.ExecuteQueryWithDictionaryResultsAsync("SELECT * FROM $SYSTEM.TMSCHEMA_TABLES");
Provides connection configuration and authentication details:
public interface IConnection
{
string ConnectionString { get; set; }
string TenantId { get; set; }
string ClientId { get; set; }
string ClientSecret { get; set; }
string Scope { get; set; }
}
Usage:
public class CustomService
{
private readonly IConnection _connection;
public CustomService(IConnection connection)
{
_connection = connection;
}
public void DoSomething()
{
var connectionString = _connection.ConnectionString;
// Use connection details...
}
}
using TabuLynx.Core.Hosting;
using TabuLynx.Core.Interfaces;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
// Create and configure host
var host = TabuLynxHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(config =>
{
config.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
config.AddEnvironmentVariables();
})
.ConfigureServices((context, services) =>
{
// Add logging
services.AddLogging(builder => builder.AddConsole());
// Core TabuLynx services (automatically configured)
services.AddSingleton<IConnection, TabuLynxConnection>();
// Add other TabuLynx packages
// services.AddAdomdQueryExecutorForLocalPowerBI();
// services.AddDmvModelExtractor();
// Add your custom services
services.AddTransient<MyDataService>();
})
.Build();
// Use services
var dataService = host.Services.GetRequiredService<MyDataService>();
await dataService.ProcessDataAsync();
public class MyDataService
{
private readonly IConnection _connection;
private readonly ILogger<MyDataService> _logger;
public MyDataService(IConnection connection, ILogger<MyDataService> logger)
{
_connection = connection;
_logger = logger;
}
public async Task ProcessDataAsync()
{
_logger.LogInformation("Processing data with connection: {ConnectionString}",
_connection.ConnectionString);
// Your business logic here
}
}
public void ConfigureTabuLynx(IServiceCollection services, IConfiguration configuration)
{
var environment = configuration["Environment"];
// Configure based on environment
switch (environment?.ToLower())
{
case "development":
services.Configure<TabuLynxOptions>(options =>
{
options.ConnectionString = "Provider=MSOLAP;Data Source=localhost:12345;";
});
break;
case "production":
services.Configure<TabuLynxOptions>(configuration.GetSection("TabuLynx"));
break;
}
services.AddSingleton<IConnection, TabuLynxConnection>();
}
public class CustomConnection : IConnection
{
public string ConnectionString { get; set; } = "";
public string TenantId { get; set; } = "";
public string ClientId { get; set; } = "";
public string ClientSecret { get; set; } = "";
public string Scope { get; set; } = "";
public CustomConnection(IConfiguration configuration)
{
// Custom configuration logic
ConnectionString = configuration.GetConnectionString("TabuLynx") ?? "";
// ... other custom initialization
}
}
// Register custom implementation
services.AddSingleton<IConnection, CustomConnection>();
using System.ComponentModel.DataAnnotations;
// Custom validation for TabuLynxOptions
services.PostConfigure<TabuLynxOptions>(options =>
{
if (string.IsNullOrWhiteSpace(options.ConnectionString))
{
throw new ValidationException("ConnectionString is required");
}
// Cloud scenarios require authentication details
if (options.ConnectionString.Contains("powerbi://") &&
(string.IsNullOrWhiteSpace(options.TenantId) ||
string.IsNullOrWhiteSpace(options.ClientId)))
{
throw new ValidationException("Cloud connections require TenantId and ClientId");
}
});
Configuration Not Found: Ensure your appsettings.json has the correct TabuLynx section:
{
"TabuLynx": {
"ConnectionString": "your-connection-string"
}
}
Validation Errors: Check that required configuration values are provided based on your target platform.
DI Registration Order: Register TabuLynx.Core services before other TabuLynx packages that depend on them.
TabuLynx.Core serves as the foundation for:
Example complete setup:
services.Configure<TabuLynxOptions>(configuration.GetSection("TabuLynx"));
services.AddSingleton<IConnection, TabuLynxConnection>(); // Core
services.AddAdomdQueryExecutorForLocalPowerBI(); // Query.Executor
services.AddDmvModelExtractor(); // Model.Extractor
Contributions, issues, and feature requests are welcome! Please feel free to check the issues page.
This project is licensed under the terms specified in the LICENSE file.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 4 NuGet packages that depend on TabuLynx.Core:
| Package | Downloads |
|---|---|
|
TabuLynx.Query.Dax.AdomdClient
A specialized package for executing DAX queries against Tabular Models using AdomdClient. |
|
|
TabuLynx.Model.Extractor.Tom
Package Description |
|
|
TabuLynx.Model.Extractor
Package Description |
|
|
TabuLynx.Query.Executor
Provide interfaces for executing queries against Tabular Models. |
This package is not used by any popular GitHub repositories.