TanvirArjel.EFCore.GenericRepository
3.0.0
.NET Standard 2.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TanvirArjel.EFCore.GenericRepository --version 3.0.0
NuGet\Install-Package TanvirArjel.EFCore.GenericRepository -Version 3.0.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="TanvirArjel.EFCore.GenericRepository" Version="3.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TanvirArjel.EFCore.GenericRepository --version 3.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TanvirArjel.EFCore.GenericRepository, 3.0.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 TanvirArjel.EFCore.GenericRepository as a Cake Addin
#addin nuget:?package=TanvirArjel.EFCore.GenericRepository&version=3.0.0
// Install TanvirArjel.EFCore.GenericRepository as a Cake Tool
#tool nuget:?package=TanvirArjel.EFCore.GenericRepository&version=3.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
How do I get started?
First, install the appropriate version of this nuget package into your project as follows:
**For EF Core 2.x π*
Install-Package TanvirArjel.EFCore.GenericRepository -Version 2.0.0
**For EF Core 3.0 π*
Install-Package TanvirArjel.EFCore.GenericRepository -Version 3.0.0
**For EF Core >= 3.1 π*
Install-Package TanvirArjel.EFCore.GenericRepository -Version 3.1.0
Then in the ConfirugeServices
method of the Startup
class:
public void ConfigureServices(IServiceCollection services)
{
string connectionString = Configuration.GetConnectionString("RepositoryDbConnection");
services.AddDbContext<DemoDbContext>(option => option.UseSqlServer(connectionString));
services.AddGenericRepository<DemoDbContext>(); // Call it just after registering your DbConext.
}
Usage:
Now inject IUnitOfWork
interface in your relevant class constructor and use as follows:
public class EmployeeService
{
private readonly IUnitOfWork _unitOfWork;
public EmployeeService(IUnitOfWork unitOfWork)
{
_unitOfWork = unitOfWork;
}
public async Task<Employee> GetEmployeeAsync(int employeeId)
{
Employee employee = await _unitOfWork.Repository<Employee>().GetEntityByIdAsync(1);
return employee;
}
}
To see more details documentation, please visit GitHub Repository
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.1 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Microsoft.EntityFrameworkCore.Relational (>= 3.0.0)
- System.Linq.Dynamic.Core (>= 1.0.19)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on TanvirArjel.EFCore.GenericRepository:
Repository | Stars |
---|---|
TanvirArjel/CleanArchitecture
This repository contains the implementation of domain-driven design and clear architecture in ASP.NET Core.
|
Version | Downloads | Last updated |
---|---|---|
6.0.0 | 2,823 | 11/9/2022 |
6.0.0-preview1 | 81 | 10/19/2022 |
5.9.1 | 1,376 | 8/21/2022 |
5.9.0 | 4,637 | 6/9/2022 |
5.8.1 | 353 | 6/7/2022 |
5.8.0 | 7,110 | 11/12/2021 |
5.7.0 | 565 | 10/6/2021 |
5.6.0 | 498 | 8/13/2021 |
5.5.0 | 3,408 | 4/7/2021 |
5.4.0 | 185 | 3/30/2021 |
5.3.0 | 317 | 3/27/2021 |
5.2.2 | 600 | 2/12/2021 |
5.2.1 | 294 | 2/8/2021 |
5.2.0 | 260 | 2/7/2021 |
5.1.0 | 363 | 1/14/2021 |
5.0.0 | 520 | 11/12/2020 |
3.1.2 | 1,447 | 5/20/2020 |
3.1.1 | 406 | 4/25/2020 |
3.1.0 | 399 | 4/23/2020 |
3.0.2 | 428 | 5/20/2020 |
3.0.1 | 373 | 4/25/2020 |
3.0.0 | 399 | 4/23/2020 |
2.0.2 | 412 | 5/20/2020 |
2.0.1 | 365 | 4/25/2020 |
2.0.0 | 366 | 4/23/2020 |
This release is for targetting EF Core version 3.0