FractalDataWorks.Data.DataSets.Abstractions 0.4.0-preview.6

This is a prerelease version of FractalDataWorks.Data.DataSets.Abstractions.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package FractalDataWorks.Data.DataSets.Abstractions --version 0.4.0-preview.6
                    
NuGet\Install-Package FractalDataWorks.Data.DataSets.Abstractions -Version 0.4.0-preview.6
                    
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="FractalDataWorks.Data.DataSets.Abstractions" Version="0.4.0-preview.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FractalDataWorks.Data.DataSets.Abstractions" Version="0.4.0-preview.6" />
                    
Directory.Packages.props
<PackageReference Include="FractalDataWorks.Data.DataSets.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FractalDataWorks.Data.DataSets.Abstractions --version 0.4.0-preview.6
                    
#r "nuget: FractalDataWorks.Data.DataSets.Abstractions, 0.4.0-preview.6"
                    
#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.
#:package FractalDataWorks.Data.DataSets.Abstractions@0.4.0-preview.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FractalDataWorks.Data.DataSets.Abstractions&version=0.4.0-preview.6&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FractalDataWorks.Data.DataSets.Abstractions&version=0.4.0-preview.6&prerelease
                    
Install as a Cake Tool

FractalDataWorks.Data.DataSets.Abstractions

Abstractions for dataset definitions, schema metadata, and LINQ-based query building for data operations across multiple sources.

Overview

Provides contracts for dataset operations:

  • Dataset Types: Define datasets with schema metadata using IDataSetType and DataSetTypeBase
  • Query Building: Build LINQ expression trees with IDataQuery<T> and DataQueryBuilder<T>
  • Field Metadata: Define field schemas with IDataField and DataField
  • Configuration: Configure datasets at runtime with DataSetConfiguration
  • Type Collections: Register datasets dynamically with DataSetTypes (MutableTypeCollection)

Target Framework: .NET Standard 2.0

Dependencies: FractalDataWorks.Collections, FractalDataWorks.Configuration, FractalDataWorks.Data.Abstractions, FractalDataWorks.Data.DataContainers.Abstractions, FractalDataWorks.Results, FractalDataWorks.Commands.Abstractions

Key Interfaces

IDataSetType

Represents a dataset definition with schema information and query capabilities.

From IDataSetType.cs:11-48:

public interface IDataSetType : ITypeOption<int, DataSetTypeBase>
{
    /// <summary>
    /// Gets the detailed description of this dataset.
    /// </summary>
    string Description { get; }

    /// <summary>
    /// Gets the .NET type of the record/entity that this dataset represents.
    /// </summary>
    Type RecordType { get; }

    /// <summary>
    /// Gets the collection of fields that define the schema of this dataset.
    /// </summary>
    IReadOnlyCollection<IDataField> Fields { get; }

    /// <summary>
    /// Gets the names of fields that form the primary key for this dataset.
    /// </summary>
    IReadOnlyCollection<string> KeyFields { get; }

    /// <summary>
    /// Gets the configuration section name where this dataset's settings are stored.
    /// </summary>
    string ConfigurationSection { get; }

    /// <summary>
    /// Gets the version of this dataset schema.
    /// </summary>
    string Version { get; }
}

IDataQuery and IDataQuery<T>

Represents a query against a dataset with LINQ expression support.

From IDataQuery.cs:16-44:

public interface IDataQuery
{
    /// <summary>
    /// Gets the LINQ expression tree representing this query.
    /// </summary>
    Expression QueryExpression { get; }

    /// <summary>
    /// Gets the name of the dataset this query targets.
    /// </summary>
    string DataSetName { get; }

    /// <summary>
    /// Gets the expected result type of this query.
    /// </summary>
    Type ResultType { get; }

    /// <summary>
    /// Gets the source record type of the dataset.
    /// </summary>
    Type SourceType { get; }
}

From IDataQuery.cs:54-99:

public interface IDataQuery<TSource> : IDataQuery
{
    /// <summary>
    /// Creates a new query with an additional Where clause.
    /// </summary>
    IDataQuery<TSource> Where(Expression<Func<TSource, bool>> predicate);

    /// <summary>
    /// Creates a new query that selects specific fields or transforms records.
    /// </summary>
    IDataQuery<TResult> Select<TResult>(Expression<Func<TSource, TResult>> selector);

    /// <summary>
    /// Creates a new query with ordering applied.
    /// </summary>
    IDataQuery<TSource> OrderBy<TKey>(Expression<Func<TSource, TKey>> keySelector);

    /// <summary>
    /// Creates a new query with descending ordering applied.
    /// </summary>
    IDataQuery<TSource> OrderByDescending<TKey>(Expression<Func<TSource, TKey>> keySelector);

    /// <summary>
    /// Creates a new query that limits the number of results.
    /// </summary>
    IDataQuery<TSource> Take(int count);

    /// <summary>
    /// Creates a new query that skips a specified number of results.
    /// </summary>
    IDataQuery<TSource> Skip(int count);
}

IDataField

Represents metadata for a field within a dataset.

From IDataField.cs:10-64:

public interface IDataField
{
    string Name { get; }
    Type FieldType { get; }
    bool IsKey { get; }
    bool IsRequired { get; }
    string? Description { get; }
    int? MaxLength { get; }
    object? DefaultValue { get; }
    bool IsCalculated { get; }
    Func<IDataRow, object>? Calculator { get; }
}

Usage

Creating a Query with DataQueryBuilder

From DataQueryBuilder.cs:44-61:

public sealed class DataQueryBuilder<TSource> : IDataQuery<TSource>
{
    /// <summary>
    /// Initializes a new instance of the <see cref="DataQueryBuilder{TSource}"/> class.
    /// </summary>
    /// <param name="dataSetName">The name of the dataset being queried.</param>
    /// <param name="expression">The current expression tree, or null for a root query.</param>
    public DataQueryBuilder(string dataSetName, Expression? expression = null)
    {
        DataSetName = dataSetName ?? throw new ArgumentNullException(nameof(dataSetName));
        QueryExpression = expression ?? Expression.Constant(
            new QueryableSource<TSource>(dataSetName),
            typeof(IQueryable<TSource>));
        SourceType = typeof(TSource);
        ResultType = typeof(TSource);
    }
    // ...
}

From DataSetTypeBase.cs:109-125:

/// <summary>
/// Creates a LINQ query builder for this dataset.
/// </summary>
/// <typeparam name="TRecord">The record type to query.</typeparam>
/// <returns>A query builder that supports LINQ operations.</returns>
/// <remarks>
/// This method enables LINQ syntax on datasets:
/// <code>
/// var query = myDataSet.CreateQuery&lt;MyRecord&gt;()
///     .Where(r => r.Status == "Active")
///     .Select(r => new { r.Id, r.Name });
/// </code>
/// The returned query builder captures LINQ expressions for translation by connection providers.
/// </remarks>
public DataQueryBuilder<TRecord> CreateQuery<TRecord>()
{
    return new DataQueryBuilder<TRecord>(Name);
}

Defining Fields with DataField

From DataField.cs:21-38:

public DataField(
    string name,
    Type type,
    bool isKey = false,
    bool isNullable = false,
    int? maxLength = null,
    string? description = null)
{
    if (string.IsNullOrWhiteSpace(name))
        throw new ArgumentException("Field name cannot be null or whitespace.", nameof(name));

    Name = name;
    Type = type ?? throw new ArgumentNullException(nameof(type));
    IsKey = isKey;
    IsNullable = isNullable;
    MaxLength = maxLength;
    Description = description;
}

Configuring Datasets at Runtime

From DataSetConfiguration.cs:14-87:

public sealed class DataSetConfiguration : ConfigurationBase<DataSetConfiguration>
{
    public string DataSetName { get; set; } = string.Empty;
    public string Description { get; set; } = string.Empty;
    public string Version { get; set; } = "1.0";
    public string Category { get; set; } = "Dataset";
    public string RecordTypeName { get; set; } = string.Empty;
    public IList<DataFieldConfiguration> Fields { get; set; } = new List<DataFieldConfiguration>();
    public IList<string> KeyFields { get; set; } = new List<string>();
    public IDictionary<string, SourceMappingConfiguration> Sources { get; set; }
        = new Dictionary<string, SourceMappingConfiguration>(StringComparer.OrdinalIgnoreCase);
    public IList<JoinConfiguration> Joins { get; set; } = new List<JoinConfiguration>();
    public CachingConfiguration? Caching { get; set; }

    public override string SectionName => $"DataSets:{DataSetName}";
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on FractalDataWorks.Data.DataSets.Abstractions:

Package Downloads
FractalDataWorks.Configuration.MsSql

Development tools and utilities for the FractalDataWorks ecosystem. Build:

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
Loading failed