AlinSpace.Database.EfCore 6.9.23

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

AlinSpace.Database.EfCore

is a Database abstraction layer. It helps to simplify the process of working with data through EntityFrameworkCore.

In order to keep the library simple, some decisions have been made:

  • Ulid is used for all primary keys. Use hash IDs to map the primary key to strings, or add additional fields.

Example

First create a database context like this:

public class MyDatabaseContext : AbstractDbContext
{
    public DbSet<Book> Books { get; set; }

    public MyDatabaseContext(DbContextOptions<DatabaseContext> options) : base(options)
    {
    }
}

Then create the options and setup the transaction like this:

// Prepare database context options.
var options = optionsBuilder.Build();

// Create the transaction object.
var transaction = TransactionFactory.Create<MyDatabaseContext>(options);

// Get repository.
var bookRepository = transaction.GetRepository<Book>();

// Create entity.
bookRepository.Create(...);
// Get entity.
bookRepository.Get(...);
// Update entity.
bookRepository.Update(...);
// Delete entity.
bookRepository.Delete(...);

// Find entity.
bookRepository.Find(...);
// Find many entities.
bookRepository.FindMany(...);

// Create a custom query.
var query = bookRepository.NewQuery();

// Commit changes.
transaction.Commit();
Product 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 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. 
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
6.20.0 339 10/28/2023
6.9.24 168 9/30/2023
6.9.23 149 9/30/2023
6.9.22 144 9/30/2023
6.9.21 206 9/1/2023
6.9.20 167 8/26/2023
6.9.17 204 7/30/2023
6.9.16 192 7/29/2023
6.9.15 203 7/29/2023
6.9.13 197 7/29/2023
6.9.12 270 7/7/2023
6.9.11 212 7/5/2023
6.9.9 212 6/30/2023
6.9.8 209 6/30/2023
6.9.4 278 3/9/2023
6.9.2 278 3/4/2023
6.9.1 289 2/17/2023
6.8.15 303 2/11/2023
6.8.13 335 1/23/2023
6.8.12 347 1/15/2023
6.8.11 638 11/9/2022
6.8.9 387 11/1/2022
6.8.8 440 10/12/2022
6.8.7 414 10/12/2022
6.8.2 425 10/11/2022
6.8.1 418 10/11/2022
6.8.0 435 10/11/2022
6.4.1 464 5/25/2022
6.4.0 460 5/25/2022
6.3.3 464 5/11/2022
6.3.2 468 5/8/2022
6.3.1 458 5/7/2022
6.3.0 454 5/7/2022
6.2.2 464 5/1/2022
6.2.1 493 4/28/2022