AlinSpace.Database.EfCore 6.20.0

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.
<PackageVersion Include="AlinSpace.Database.EfCore" Version="6.20.0" />
                    
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.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.
#addin nuget:?package=AlinSpace.Database.EfCore&version=6.20.0
                    
Install AlinSpace.Database.EfCore as a Cake Addin
#tool nuget:?package=AlinSpace.Database.EfCore&version=6.20.0
                    
Install AlinSpace.Database.EfCore 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. 
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 321 10/28/2023
6.9.24 154 9/30/2023
6.9.23 138 9/30/2023
6.9.22 132 9/30/2023
6.9.21 192 9/1/2023
6.9.20 149 8/26/2023
6.9.17 183 7/30/2023
6.9.16 174 7/29/2023
6.9.15 181 7/29/2023
6.9.13 177 7/29/2023
6.9.12 254 7/7/2023
6.9.11 195 7/5/2023
6.9.9 189 6/30/2023
6.9.8 189 6/30/2023
6.9.4 254 3/9/2023
6.9.2 255 3/4/2023
6.9.1 269 2/17/2023
6.8.15 283 2/11/2023
6.8.13 312 1/23/2023
6.8.12 329 1/15/2023
6.8.11 619 11/9/2022
6.8.9 368 11/1/2022
6.8.8 417 10/12/2022
6.8.7 396 10/12/2022
6.8.2 404 10/11/2022
6.8.1 398 10/11/2022
6.8.0 413 10/11/2022
6.4.1 439 5/25/2022
6.4.0 435 5/25/2022
6.3.3 437 5/11/2022
6.3.2 442 5/8/2022
6.3.1 427 5/7/2022
6.3.0 427 5/7/2022
6.2.2 435 5/1/2022
6.2.1 457 4/28/2022