Gholi 1.2.39

dotnet add package Gholi --version 1.2.39
                    
NuGet\Install-Package Gholi -Version 1.2.39
                    
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="Gholi" Version="1.2.39" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gholi" Version="1.2.39" />
                    
Directory.Packages.props
<PackageReference Include="Gholi" />
                    
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 Gholi --version 1.2.39
                    
#r "nuget: Gholi, 1.2.39"
                    
#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 Gholi@1.2.39
                    
#: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=Gholi&version=1.2.39
                    
Install as a Cake Addin
#tool nuget:?package=Gholi&version=1.2.39
                    
Install as a Cake Tool

๐Ÿ“ฆ Gholi โ€“ Generic Repository for EF Core(Use Latest Version) Gholi is a lightweight and practical library for building generic repositories using Entity Framework Core. It helps you manage database operations without repeating boilerplate code for CRUD actions.

โœจ Features Full CRUD support (Create, Read, Update, Delete)

Filtering with Expression<Func<TEntity, bool>>

Based on Repository Pattern and Separation of Concerns

Flexible and reusable in any EF Core-based project

Built-in Soft Delete support

Easy to use โ€“ no need to write repository classes per entity

๐Ÿ— Project Structure Copy Edit ๐Ÿ“ฆ Gholi/ โ”ฃ ๐Ÿ“‚ Services/ โ”ƒ โ”ฃ ๐Ÿ“„ IGholiCommandService.cs โ”ƒ โ”ฃ ๐Ÿ“„ IGholiQueryService.cs โ”ƒ โ”ฃ ๐Ÿ“„ GholiCommandService.cs โ”ƒ โ”— ๐Ÿ“„ GholiQueryService.cs โ”ฃ ๐Ÿ“„ Extensions.cs โ”— ๐Ÿ“„ Gholi.csproj โš™ Usage

  1. Installation (if published as a NuGet package) bash Copy Edit dotnet add package Gholi

  2. Define your DbContext and Entity csharp Copy Edit public class Car { public long Id { get; set; } public string CarName { get; set; } public bool IsDeleted { get; set; } }

  3. Register services in Program.cs or Startup.cs csharp Copy Edit services.AddScoped(typeof(IGholiCommandService<,,>), typeof(GholiCommandService<,,>)); services.AddScoped(typeof(IGholiQueryService<,,>), typeof(GholiQueryService<,,>));

  4. Use in a controller csharp Copy Edit public class TestController : Controller { private readonly IGholiCommandService<TestDbContext, Car, long> _command; private readonly IGholiQueryService<TestDbContext, Car, long> _query;

    public TestController( IGholiCommandService<TestDbContext, Car, long> command, IGholiQueryService<TestDbContext, Car, long> query) { _command = command; _query = query; }

    public async Task<IActionResult> Index() { var cars = await _query.FilterAsync(c โ‡’ c.CarName.StartsWith("mazda")); return View(cars); }

    public async Task<IActionResult> Create() { var newCar = new Car { CarName = "mazda" }; await _command.CreateOneAsync(newCar); return RedirectToAction("Index"); } } โœ… Available Methods IGholiQueryService: GetAllAsync()

FindByIdAsync(id)

FilterAsync(Expression<Func<TEntity, bool>> predicate)

AnyAsync(predicate)

CountAsync(predicate)

IGholiCommandService: CreateOneAsync(entity)

CreateManyAsync(entities)

UpdateAsync(entity)

DeleteAsync(id) (Soft delete)

DeleteManyAsync(predicate) (Soft delete)

RestoreAsync(id) (Restores soft-deleted record)

๐Ÿ“Œ Notes All delete operations use Soft Delete (IsDeleted = true).

FilterAsync() excludes soft-deleted items by default.

Your entity must have a bool IsDeleted property for compatibility.

๐Ÿงช Testing You can easily unit test GholiCommandService and GholiQueryService using frameworks like xUnit or NUnit, as they're fully mockable.

๐Ÿ“„ License This project is licensed under the MIT License. You are free to use it for personal or commercial projects.

๐Ÿง  Author Developed by: Shayan Khalaj

Email: ShayanKhalaj90@gmail.com

GitHub:

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
1.2.39 257 6/9/2025
1.1.40 244 6/9/2025
1.0.23 448 6/9/2025 1.0.23 is deprecated because it is no longer maintained and has critical bugs.
1.0.22 417 6/9/2025 1.0.22 is deprecated because it is no longer maintained and has critical bugs.
1.0.21 418 6/9/2025 1.0.21 is deprecated because it is no longer maintained and has critical bugs.
1.0.20 420 6/9/2025 1.0.20 is deprecated because it is no longer maintained and has critical bugs.
1.0.19 419 6/9/2025 1.0.19 is deprecated because it is no longer maintained and has critical bugs.
1.0.18 424 6/9/2025 1.0.18 is deprecated because it is no longer maintained and has critical bugs.
1.0.17 426 6/9/2025 1.0.17 is deprecated because it is no longer maintained and has critical bugs.
1.0.16 417 6/9/2025 1.0.16 is deprecated because it is no longer maintained and has critical bugs.
1.0.12 291 6/7/2025 1.0.12 is deprecated because it is no longer maintained and has critical bugs.
1.0.11 280 6/7/2025 1.0.11 is deprecated because it is no longer maintained and has critical bugs.
1.0.10 289 6/7/2025 1.0.10 is deprecated because it is no longer maintained and has critical bugs.
1.0.9 274 6/7/2025 1.0.9 is deprecated because it is no longer maintained and has critical bugs.
1.0.8 353 6/3/2025 1.0.8 is deprecated because it is no longer maintained and has critical bugs.
1.0.7 362 6/3/2025 1.0.7 is deprecated because it is no longer maintained and has critical bugs.
1.0.6 362 6/3/2025 1.0.6 is deprecated because it is no longer maintained and has critical bugs.
1.0.5 361 6/3/2025 1.0.5 is deprecated because it is no longer maintained and has critical bugs.
1.0.4 356 6/3/2025 1.0.4 is deprecated because it is no longer maintained and has critical bugs.
1.0.3 359 6/3/2025 1.0.3 is deprecated because it is no longer maintained and has critical bugs.
1.0.2 358 6/3/2025 1.0.2 is deprecated because it is no longer maintained and has critical bugs.
1.0.1 358 6/3/2025 1.0.1 is deprecated because it is no longer maintained and has critical bugs.
1.0.0 362 6/3/2025 1.0.0 is deprecated because it is no longer maintained and has critical bugs.