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
                    
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="LF.GenericRepository.EntityFrameworkCore" Version="2.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LF.GenericRepository.EntityFrameworkCore" Version="2.2.2" />
                    
Directory.Packages.props
<PackageReference Include="LF.GenericRepository.EntityFrameworkCore" />
                    
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 LF.GenericRepository.EntityFrameworkCore --version 2.2.2
                    
#r "nuget: LF.GenericRepository.EntityFrameworkCore, 2.2.2"
                    
#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.
#:package LF.GenericRepository.EntityFrameworkCore@2.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LF.GenericRepository.EntityFrameworkCore&version=2.2.2
                    
Install as a Cake Addin
#tool nuget:?package=LF.GenericRepository.EntityFrameworkCore&version=2.2.2
                    
Install as a Cake Tool

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 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. 
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
2.2.2 141 6/17/2024
2.2.1 143 5/31/2024
2.2.0 133 5/31/2024
2.1.0 116 5/22/2024
2.0.0 143 5/15/2024
1.0.0 290 5/20/2022