https://github.com/bigbuildbench/tanvirarjel_efcore.genericrepository
https://github.com/bigbuildbench/tanvirarjel_efcore.genericrepository
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: BigBuildBench
- License: mit
- Language: C#
- Default Branch: master
- Size: 1.42 MB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
EF Core Generic Repository
This library is a Generic Repository implementation for EF Core ORM which will remove developers' pain to write repository layer for each .NET Core and .NET project.
⭐ Giving a star
If you find this library useful, please don't forget to encourage me to do such more stuffs by giving a star to this repository. Thank you.
🔥 What's new
Pagination Support:
```C#
PaginationSpecification
PaginatedList
Free raw SQL support:
```C#
List
```
⚙️ This library includes following notable features:
This library can be run on any .NET Core or .NET application which has .NET Core 3.1, .NET Standard 2.1 and .NET 5.0+ support.
It’s providing the Generic Repository with database transaction support.
It has all the required methods to query your data in whatever way you want without getting IQueryable
from the repository. It also has
Specification<T>pattern support so that you can build your query dynamically i.e. differed query building.It also has database level projection support for your query.
It also has support to run raw SQL command against your relational database.
It also has support to choose whether you would like to track your query entity/entities or not.
It also has support to reset your EF Core DbContext state whenever you really needed.
Most importantly, it has full Unit Testing support.
Pagination support.
Free raw SQL query support both for complex type and primitive types.
✈️ How do I get started?
For full version (both query and command support):
First install the latest version of TanvirArjel.EFCore.GenericRepository nuget package into your project as follows:
Package Manager Console:
C#
Install-Package TanvirArjel.EFCore.GenericRepository
.NET CLI:
C#
dotnet add package TanvirArjel.EFCore.GenericRepository
Then in the ConfigureServices method of the Startup class:
```C#
public void ConfigureServices(IServiceCollection services)
{
// For single DbContext
services.AddGenericRepository
// If multiple DbContext
services.AddGenericRepository<YourDbContext1>();
services.AddGenericRepository<YourDbContext2>();
} ```
For query version only:
First install the latest version of TanvirArjel.EFCore.QueryRepository nuget package into your project as follows:
Package Manager Console:
C#
Install-Package TanvirArjel.EFCore.QueryRepository
.NET CLI:
C#
dotnet add package TanvirArjel.EFCore.QueryRepository
Then in the ConfigureServices method of the Startup class:
```C#
public void ConfigureServices(IServiceCollection services)
{
// For single DbContext
services.AddQueryRepository
// For multiple DbContext
services.AddQueryRepository<YourDbContext1>();
services.AddQueryRepository<YourDbContext2>();
} ```
🛠️ Usage: Query
``C#
public class EmployeeService
{
// For query version, please useIQueryRepositoryinstead ofIRepository`
private readonly IRepository _repository; // If single DbContext
private readonly IRepository
public EmployeeService(IRepository repository, IRepository<YourDbContext1> dbContext1Repository)
{
_repository = repository;
_dbContext1Repository = dbContext1Repository;
}
public async Task<Employee> GetEmployeeAsync(int employeeId)
{
Employee employee = await _repository.GetByIdAsync<Employee>(employeeId);
return employee;
}
} ```
🛠️ Usage: Command
```C#
public class EmployeeService
{
private readonly IRepository _repository; // If single DbContext
private readonly IRepository
public EmployeeService(IRepository repository, IRepository<YourDbContext1> dbContext1Repository)
{
_repository = repository;
_dbContext1Repository = dbContext1Repository;
}
public async Task<int> CreateAsync(Employee employee)
{
await _repository.AddAsync(employee);
await _repository.SaveChangesAsync();
return employee.Id;
}
} ```
For more detail documentation, please visit Documentation Wiki
Owner
- Name: BigBuildBench
- Login: BigBuildBench
- Kind: organization
- Repositories: 1
- Profile: https://github.com/BigBuildBench
abbr. B3, benchmarking the repo-level understanding capability of your LLMs by reconstructing project build-file.
GitHub Events
Total
- Create event: 8
Last Year
- Create event: 8
Dependencies
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-dotnet v3 composite
- actions/upload-artifact v3 composite