STX.EFCore.Client 0.0.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package STX.EFCore.Client --version 0.0.0.3
                    
NuGet\Install-Package STX.EFCore.Client -Version 0.0.0.3
                    
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="STX.EFCore.Client" Version="0.0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="STX.EFCore.Client" Version="0.0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="STX.EFCore.Client" />
                    
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 STX.EFCore.Client --version 0.0.0.3
                    
#r "nuget: STX.EFCore.Client, 0.0.0.3"
                    
#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 STX.EFCore.Client@0.0.0.3
                    
#: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=STX.EFCore.Client&version=0.0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=STX.EFCore.Client&version=0.0.0.3
                    
Install as a Cake Tool

STX.EFCore.Client

A Standard compliant client to wrap EF Core operations that can be used in a Storage Broker. This includes bulk operations from the popular Entity Framework Extensions for EF Core library. (Z.EntityFramework.Extensions.EFCore)

Main Features

  • InsertAsync
  • SelectAllAsync
  • SelectAsync
  • UpdateAsync
  • DeleteAsync
  • BulkInsertAsync
  • BulkReadAsync
  • BulkUpdateAsync
  • BulkDeleteAsync

How do I use this?

Currently a storage broker looks something this:

    public partial class StorageBroker : EFxceptionsContext, IStorageBroker
    {
        private readonly IConfiguration configuration;

        public StorageBroker(IConfiguration configuration)
        {
            this.configuration = configuration;
            this.Database.Migrate();
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            AddConfigurations(modelBuilder);
        }

        private static void AddConfigurations(ModelBuilder modelBuilder)
        {
            . . .
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            . . .
        }

        private async ValueTask<T> InsertAsync<T>(T @object)
            where T : class 
        {
            this.Entry(@object).State = EntityState.Added;
            await this.SaveChangesAsync();
            this.Entry(@object).State = EntityState.Detached;

            return @object;
        }

        private async ValueTask<IQueryable<T>> SelectAllAsync<T>() 
            where T : class =>
                this.Set<T>();

        private async ValueTask<T> SelectAsync<T>(params object[] @objectIds) 
            where T : class =>
                await this.FindAsync<T>(objectIds);

        private async ValueTask<T> UpdateAsync<T>(T @object) 
            where T : class
        {
            this.Entry(@object).State = EntityState.Modified;
            await this.SaveChangesAsync();
            this.Entry(@object).State = EntityState.Detached;

            return @object;
        }
                
        private async ValueTask<T> DeleteAsync<T>(T @object) 
            where T : class
        {
            this.Entry(@object).State = EntityState.Deleted;
            await this.SaveChangesAsync();
            this.Entry(@object).State = EntityState.Detached;

            return @object;
        }
    }

With the client it will look like this and it addresses the sequencing issue that we currently have in brokers.

    public partial class StorageBroker : EFxceptionsContext, IStorageBroker
    {
        private readonly IConfiguration configuration;
        private readonly IEFCoreClient efCoreClient;

        public StorageBroker(IConfiguration configuration)
        {
            this.configuration = configuration;
            this.Database.Migrate();
            this.efCoreClient = new EFCoreClient(this);
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            AddConfigurations(modelBuilder);
        }

        private static void AddConfigurations(ModelBuilder modelBuilder)
        {
            . . .
        }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            . . .
        }

        private async ValueTask<T> InsertAsync<T>(T @object) where T : class =>
            await efCoreClient.InsertAsync(@object);

        private async ValueTask<IQueryable<T>> SelectAllAsync<T>() where T : class =>
            await efCoreClient.SelectAllAsync<T>();

        private async ValueTask<T> SelectAsync<T>(params object[] @objectIds) where T : class =>
            await efCoreClient.SelectAsync<T>(@objectIds);

        private async ValueTask<T> UpdateAsync<T>(T @object) where T : class =>
            await efCoreClient.UpdateAsync(@object);

        private async ValueTask<T> DeleteAsync<T>(T @object) where T : class =>
            await efCoreClient.DeleteAsync(@object);

        private async ValueTask BulkInsertAsync<T>(IEnumerable<T> objects) where T : class =>
            await efCoreClient.BulkInsertAsync<T>(objects);
            
        private async ValueTask BulkReadAsync<T>(IEnumerable<T> objects) where T : class =>
            await efCoreClient.BulkReadAsync<T>(objects);

        private async ValueTask BulkUpdateAsync<T>(IEnumerable<T> objects) where T : class =>
            await efCoreClient.BulkUpdateAsync<T>(objects);

        private async ValueTask BulkDeleteAsync<T>(IEnumerable<T> objects) where T : class =>
            await efCoreClient.BulkDeleteAsync<T>(objects);
    }
Product Compatible and additional computed target framework versions.
.NET 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.  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. 
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 STX.EFCore.Client:

Package Downloads
EventHighway

Standard-Compliant Open-Source Pub/Sub .NET library for managing events in distributed systems.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0 2,082 5/8/2026
2.0.0 5,626 12/16/2024
1.0.0 1,899 11/26/2024
0.0.0.4 390 11/13/2024
0.0.0.3 1,278 10/4/2024
0.0.0.2 232 10/2/2024
0.0.0.1 196 10/2/2024

Initial release of the client.