SimpleEfCoreRepository 1.0.0
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 SimpleEfCoreRepository --version 1.0.0
NuGet\Install-Package SimpleEfCoreRepository -Version 1.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="SimpleEfCoreRepository" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleEfCoreRepository" Version="1.0.0" />
<PackageReference Include="SimpleEfCoreRepository" />
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 SimpleEfCoreRepository --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SimpleEfCoreRepository, 1.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.
#:package SimpleEfCoreRepository@1.0.0
#: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=SimpleEfCoreRepository&version=1.0.0
#tool nuget:?package=SimpleEfCoreRepository&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EF.Core.Repository
Simple repository for Ef.Core with basic CRUD functionality
The reason I implemented this is that I kept writing basic CRUD functionality over and over again.
How to use
- Entity should implement
IEntity
public class DummyModel : IEntity<int>
{
public int Id { get; set; }
public string Name { get; set; }
public List<Nested> Children { get; set; }
}
- Create profile which is used to update an entity given a DTO
public class DummyModelProfile : IEntityProfile<DummyModel, int>
{
private readonly IEntityProfileAuxiliary<Nested, int> _auxiliary;
// Optionally inject utility for list add/delete
public DummyModelProfile(IEntityProfileAuxiliary<Nested, int> auxiliary)
{
_auxiliary = auxiliary;
}
public DummyModel Update(DummyModel entity, DummyModel dto)
{
entity.Name = dto.Name;
// ModifyList will try to add/delete entities based on Id based on whether they
// appear in dto.Children or not
entity.Children = _auxiliary.ModifyList(entity.Children, dto.Children);
// Return entity or response
// This will be used as a return value for update method in BasicCrud
return entity;
}
// Intercept IQueryable to include related entities
public IQueryable<DummyModel> Include<TQueryable>(TQueryable queryable) where TQueryable : IQueryable<DummyModel>
{
return queryable.Children();
}
}
- Register dependency via
IServiceCollectionextension
var serviceProvider = services
.AddEfRepository<EntityDbContext>(options => options
.Profiles(Assembly.GetExecutingAssembly()));
- Use
IBasicCrud
IEfRepository repo = ... // DI inject IEfRepository
// Get IBasicCrud instance
IBasicCrud<DummyModel> = repo.For<DummyModel>();
- Available methods in
IBasicCrud
Task<IEnumerable<TSource>> GetAll();
Task<TSource> Get(id);
Task<TSource> Save(dto);
Task<TSource> Delete(id);
Task<TSource> Update(id, dto);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. 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. |
| .NET Core | netcoreapp3.1 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- Microsoft.EntityFrameworkCore (>= 3.1.4)
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 | |
|---|---|---|---|
| 3.1.16 | 215 | 8/9/2025 | |
| 3.1.15 | 292 | 6/16/2025 | |
| 3.1.14 | 1,030 | 4/4/2025 | |
| 3.1.13 | 175 | 4/4/2025 | |
| 3.1.12 | 184 | 4/4/2025 | |
| 3.1.11 | 200 | 4/3/2025 | |
| 3.1.10 | 241 | 3/31/2025 | |
| 3.1.8 | 615 | 3/24/2025 | |
| 3.1.7 | 497 | 3/24/2025 | |
| 3.1.6 | 373 | 3/24/2025 | |
| 3.1.5 | 195 | 3/23/2025 | |
| 3.1.4 | 120 | 3/22/2025 | |
| 3.1.3 | 213 | 3/19/2025 | |
| 3.1.2 | 376 | 3/4/2025 | |
| 3.1.1 | 206 | 2/25/2025 | |
| 3.1.0 | 141 | 2/24/2025 | |
| 3.0.22 | 129 | 2/24/2025 | |
| 3.0.21 | 402 | 12/22/2024 | |
| 3.0.20 | 201 | 12/10/2024 | |
| 3.0.19 | 262 | 11/15/2024 | |
| 3.0.18 | 170 | 11/9/2024 | |
| 3.0.17 | 146 | 11/9/2024 | |
| 3.0.16 | 150 | 11/9/2024 | |
| 3.0.15 | 177 | 11/5/2024 | |
| 3.0.14 | 525 | 4/28/2023 | |
| 3.0.13 | 328 | 4/16/2023 | |
| 3.0.12 | 314 | 4/16/2023 | |
| 3.0.11 | 351 | 3/21/2023 | |
| 3.0.10 | 339 | 3/9/2023 | |
| 3.0.9 | 340 | 3/9/2023 | |
| 3.0.8 | 542 | 10/13/2022 | |
| 3.0.7 | 594 | 9/18/2022 | |
| 3.0.6 | 559 | 9/10/2022 | |
| 3.0.5 | 531 | 9/10/2022 | |
| 3.0.4 | 525 | 9/10/2022 | |
| 3.0.3 | 561 | 9/8/2022 | |
| 3.0.2 | 547 | 9/8/2022 | |
| 3.0.1 | 817 | 7/12/2022 | |
| 3.0.0 | 788 | 6/20/2022 | |
| 2.1.5 | 591 | 6/20/2022 | |
| 2.1.4 | 603 | 4/19/2021 | |
| 2.1.3 | 532 | 4/19/2021 | |
| 2.1.2 | 495 | 4/18/2021 | |
| 2.1.1 | 566 | 4/17/2021 | |
| 2.1.0 | 547 | 4/17/2021 | |
| 2.0.2 | 588 | 1/2/2021 | |
| 2.0.1 | 624 | 1/2/2021 | |
| 2.0.0 | 565 | 12/28/2020 | |
| 1.0.8 | 633 | 11/5/2020 | |
| 1.0.7 | 647 | 8/16/2020 | |
| 1.0.6 | 631 | 8/10/2020 | |
| 1.0.5 | 609 | 8/10/2020 | |
| 1.0.4 | 675 | 6/20/2020 | |
| 1.0.3 | 653 | 6/20/2020 | |
| 1.0.2 | 618 | 6/17/2020 | |
| 1.0.1 | 699 | 5/25/2020 | |
| 1.0.0 | 725 | 5/24/2020 |
Simple repository pattern for EF.Core