LogicBuilder.App.Bsl.Utils 1.0.5

Prefix Reserved
dotnet add package LogicBuilder.App.Bsl.Utils --version 1.0.5
                    
NuGet\Install-Package LogicBuilder.App.Bsl.Utils -Version 1.0.5
                    
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="LogicBuilder.App.Bsl.Utils" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LogicBuilder.App.Bsl.Utils" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="LogicBuilder.App.Bsl.Utils" />
                    
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 LogicBuilder.App.Bsl.Utils --version 1.0.5
                    
#r "nuget: LogicBuilder.App.Bsl.Utils, 1.0.5"
                    
#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 LogicBuilder.App.Bsl.Utils@1.0.5
                    
#: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=LogicBuilder.App.Bsl.Utils&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=LogicBuilder.App.Bsl.Utils&version=1.0.5
                    
Install as a Cake Tool

LogicBuilder.App.Bsl.Utils

CI CodeQL codecov Quality Gate Status NuGet

A .NET library that provides utilities for handling query requests with dynamic filters, expansions, and projections for Entity Framework Core applications. This library enables type-safe, expression-based querying with support for both generic and non-generic scenarios, making it ideal for building flexible data access layers in enterprise applications.

Features

  • Dynamic Query Building: Construct complex LINQ queries using expression descriptors
  • Type-Safe Operations: Generic methods ensure compile-time type safety while supporting runtime type resolution
  • Filter & Select Operations: Build and execute filtered queries with custom select projections
  • Expand/Include Support: Dynamically include related entities using SelectExpandDefinition
  • Anonymous Type Support: Query and return dynamic/anonymous types for flexible data transfer objects
  • Entity Retrieval: Retrieve single entities with filtering and expansion capabilities
  • List Queries: Execute queries that return collections with flexible return types (IEnumerable, IQueryable, etc.)
  • Delete Operations: Execute delete operations using dynamic filter expressions
  • Persistence Operations: Synchronous wrappers for common Entity Framework Core CRUD operations
  • Entity Framework Core: Built on top of Entity Framework Core for robust data access

Core Components

IRequestHelper Interface

The main interface providing three primary operations:

  • GetEntity: Retrieve a single entity based on a filter expression
  • GetList: Retrieve a typed list of entities with custom projections
  • GetAnonymousList: Retrieve a list of dynamic objects for anonymous type projections

Each method supports both generic and non-generic overloads for maximum flexibility.

Operation Interfaces

IDeleteOperations

Provides delete operations using parameter-based filter expressions:

  • Delete<TModel, TData>: Delete entities matching a FilterLambdaOperatorParameters expression
IProjectionOperations

Provides entity retrieval with filtering, querying, and expansion support:

  • Get<TModel, TData>: Retrieve a single entity with optional filtering, query functions, and expansion
  • GetItems<TModel, TData>: Retrieve a collection of entities with optional filtering, query functions, and expansion
IQueryOperations

Provides advanced query operations with flexible return types:

  • Query<TModel, TData, TModelReturn, TDataReturn>: Execute custom LINQ queries with mapping between model and data types

Static Operation Classes

PersistenceOperations<TModel, TData>

Provides synchronous wrappers for Entity Framework Core persistence operations:

  • AddChange: Add or update a single entity
  • AddChanges: Add or update multiple entities
  • AddGraphChange: Add or update an entity graph (with related entities)
  • AddGraphChanges: Add or update multiple entity graphs
  • Delete: Delete entities matching a filter expression
  • Save: Save a single entity
  • SaveList: Save multiple entities
  • SaveGraph: Save an entity graph
  • SaveGraphs: Save multiple entity graphs
DeleteOperations<TModel, TData>

Static wrapper for delete operations:

  • Delete: Execute delete operations using FilterLambdaOperatorParameters
ProjectionOperations<TModel, TData>

Static wrappers for projection operations:

  • Get (GetSingle): Retrieve a single entity synchronously
  • GetItems (GetList): Retrieve a collection of entities synchronously
QueryOperations<TModel, TData, TModelReturn, TDataReturn>

Static wrapper for query operations:

  • Query: Execute custom queries with flexible return types synchronously

All static operation classes use the [AlsoKnownAs] and [FunctionGroup] attributes for integration with the LogicBuilder framework, enabling these methods to be called from business rules and workflows.

Request Types

  • GetEntityRequest: Defines entity retrieval with filter and optional select/expand definitions
  • GetTypedListRequest: Defines list queries with selector expressions and optional expansions
  • GetObjectListRequest: Defines queries returning dynamic/anonymous objects

Response Types

  • GetEntityResponse: Contains the retrieved entity and success status
  • GetListResponse: Contains the retrieved list and success status
  • GetObjectListResponse: Contains dynamic objects and success status

Use Cases

  • Building flexible Web APIs with OData-like query capabilities
  • Implementing repository patterns with dynamic query construction
  • Creating data access layers that support runtime type resolution
  • Developing business logic layers that require expression-based filtering and projection
  • Building applications that need to query data using externally-defined expression descriptors
  • Executing persistence operations (CRUD) with type-safe generic methods
  • Integrating data operations with rule-based business logic systems
  • Performing complex entity graph operations (saving entities with related data)

Dependencies

  • LogicBuilder.App.Bsl.Business: Business layer components for requests and responses
  • LogicBuilder.App.Common.Utils: Common utilities for mapping operations
  • LogicBuilder.EntityFrameworkCore: EF Core extensions and repository patterns
  • LogicBuilder.Attributes: Attributes for function metadata and framework integration
  • .NET 10.0: Built for the latest .NET platform

Example Scenarios

The library handles complex scenarios such as:

  • Querying departments with related courses using expand definitions
  • Selecting and projecting entities to different model types (e.g., Department → LookUpsModel)
  • Ordering, filtering, and limiting results dynamically
  • Grouping data with aggregations (e.g., group students by enrollment date with counts)
  • Type-safe mapping between entity types and model types using expression descriptors
  • Deleting entities based on dynamic filter expressions
  • Saving entity graphs with related entities in a single operation
  • Executing synchronous CRUD operations from business rules

Target Framework

  • .NET 10.0

License

MIT License - Copyright © BPS 2026

Repository

https://github.com/BpsLogicBuilder/LogicBuilder.App.Bsl.Utils

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.5 121 7/29/2026

Making NuGet one of the release feeds.