AlinSpace.Database.EfCore 6.8.15

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.8.15                
NuGet\Install-Package AlinSpace.Database.EfCore -Version 6.8.15                
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.8.15" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AlinSpace.Database.EfCore --version 6.8.15                
#r "nuget: AlinSpace.Database.EfCore, 6.8.15"                
#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.
// Install AlinSpace.Database.EfCore as a Cake Addin
#addin nuget:?package=AlinSpace.Database.EfCore&version=6.8.15

// Install AlinSpace.Database.EfCore as a Cake Tool
#tool nuget:?package=AlinSpace.Database.EfCore&version=6.8.15                

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 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. 
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 298 10/28/2023
6.9.24 145 9/30/2023
6.9.23 130 9/30/2023
6.9.22 123 9/30/2023
6.9.21 182 9/1/2023
6.9.20 141 8/26/2023
6.9.17 173 7/30/2023
6.9.16 165 7/29/2023
6.9.15 170 7/29/2023
6.9.13 168 7/29/2023
6.9.12 242 7/7/2023
6.9.11 187 7/5/2023
6.9.9 179 6/30/2023
6.9.8 178 6/30/2023
6.9.4 240 3/9/2023
6.9.2 240 3/4/2023
6.9.1 252 2/17/2023
6.8.15 267 2/11/2023
6.8.13 296 1/23/2023
6.8.12 313 1/15/2023
6.8.11 600 11/9/2022
6.8.9 350 11/1/2022
6.8.8 397 10/12/2022
6.8.7 375 10/12/2022
6.8.2 383 10/11/2022
6.8.1 377 10/11/2022
6.8.0 393 10/11/2022
6.4.1 417 5/25/2022
6.4.0 413 5/25/2022
6.3.3 415 5/11/2022
6.3.2 421 5/8/2022
6.3.1 405 5/7/2022
6.3.0 405 5/7/2022
6.2.2 413 5/1/2022
6.2.1 433 4/28/2022