AlinSpace.Database.EfCore 6.20.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package AlinSpace.Database.EfCore --version 6.20.0
NuGet\Install-Package AlinSpace.Database.EfCore -Version 6.20.0
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.20.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AlinSpace.Database.EfCore --version 6.20.0
#r "nuget: AlinSpace.Database.EfCore, 6.20.0"
#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.20.0

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

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. 
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 249 10/28/2023
6.9.24 110 9/30/2023
6.9.23 93 9/30/2023
6.9.22 95 9/30/2023
6.9.21 151 9/1/2023
6.9.20 107 8/26/2023
6.9.17 135 7/30/2023
6.9.16 136 7/29/2023
6.9.15 130 7/29/2023
6.9.13 133 7/29/2023
6.9.12 207 7/7/2023
6.9.11 152 7/5/2023
6.9.9 143 6/30/2023
6.9.8 142 6/30/2023
6.9.4 205 3/9/2023
6.9.2 207 3/4/2023
6.9.1 219 2/17/2023
6.8.15 234 2/11/2023
6.8.13 265 1/23/2023
6.8.12 279 1/15/2023
6.8.11 575 11/9/2022
6.8.9 325 11/1/2022
6.8.8 363 10/12/2022
6.8.7 350 10/12/2022
6.8.2 350 10/11/2022
6.8.1 344 10/11/2022
6.8.0 363 10/11/2022
6.4.1 386 5/25/2022
6.4.0 376 5/25/2022
6.3.3 387 5/11/2022
6.3.2 390 5/8/2022
6.3.1 372 5/7/2022
6.3.0 379 5/7/2022
6.2.2 380 5/1/2022
6.2.1 395 4/28/2022