LF.GenericRepository.EntityFrameworkCore
2.2.2
dotnet add package LF.GenericRepository.EntityFrameworkCore --version 2.2.2
NuGet\Install-Package LF.GenericRepository.EntityFrameworkCore -Version 2.2.2
<PackageReference Include="LF.GenericRepository.EntityFrameworkCore" Version="2.2.2" />
<PackageVersion Include="LF.GenericRepository.EntityFrameworkCore" Version="2.2.2" />
<PackageReference Include="LF.GenericRepository.EntityFrameworkCore" />
paket add LF.GenericRepository.EntityFrameworkCore --version 2.2.2
#r "nuget: LF.GenericRepository.EntityFrameworkCore, 2.2.2"
#:package LF.GenericRepository.EntityFrameworkCore@2.2.2
#addin nuget:?package=LF.GenericRepository.EntityFrameworkCore&version=2.2.2
#tool nuget:?package=LF.GenericRepository.EntityFrameworkCore&version=2.2.2
Generic Repository Package For Entity Framework Core
Application meant to be used as a nuget package to abstract simple CRUD operations
💻 Requirements
Before we begin, check that you have met the following requirements:
- You have installed the latest version of
.NET
. - You have a running local instance of
SQL SERVER
.
🚀 Getting Started
Install the package on your app using the command below
Install-Package LF.GenericRepository.EntityFrameworkCore
☕ Using in your project
In order to configure in your project follow this steps
Create your model class inheriting from BaseModel
public class Product : BaseModel
{
public string Name { get; set; }
public double Price { get; set; }
}
Create your context class
public class Context : GenericDbContext
{
public Context(DbContextOptions options)
: base(options)
{
}
public DbSet<Product> Products { get; set; }
}
Create your repository
public class ProductRepository : GenericRepository<Product>
{
private Context _db;
public ProductRepository(Context db) : base(db)
{
_db = db;
}
}
Add your database configuration in Program.cs
builder.Services.AddGenericRepositorySqlServer<Context>("YOUR_CONNECTION_STRING");
Thats it! Your repository should have all the functions needed for all basic CRUD operations.
Product | Versions 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. |
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.5)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.