Say goodbye to repetitive CRUD boilerplate and hello to a streamlined, asynchronous-first approach to data access in your .NET applications! Buzruk.GenericRepository is your supercharged generic repository, offering a unified interface to work with various entities. Focus on building amazing features while this package handles the data interaction heavy lifting.
$ dotnet add package Buzruk.GenericRepository
Say goodbye to repetitive CRUD boilerplate and hello to a streamlined, asynchronous-first approach to data access in your .NET applications! Buzruk.GenericRepository is your supercharged generic repository, offering a unified interface to work with various entities. Focus on building amazing features while this package handles the data interaction heavy lifting.
This generic repository simplifies data access in .NET applications by offering a unified interface for working with various entity types. It supports both synchronous and asynchronous methods, providing you with flexibility based on your application's requirements. By using this repository, you can focus on business logic and reduce boilerplate code related to data interactions.
GetAsync, GetPagedAsync, AddAsync, AddRangeAsync, UpdateAsync, UpdateRangeAsync, RemoveAsync, and RemoveRangeAsync. Simplify complex data management.GetAsync method. Get exactly the data you need, when you need it.GetPagedAsync. Retrieve data in manageable chunks, ideal for pagination and performance optimization. No more overwhelming data loads! ⚖️ExistsAsync to make informed decisions in your code. Avoid unnecessary database calls.CountAsync) or utilize LongCountAsync for accurate counts even with very large datasets. Always have a clear picture of your data.CountByAsync. Gain deeper insights into your data distribution.EagerLoadAsync), minimizing subsequent database calls. Reduce roundtrips and improve responsiveness.dotnet add package Buzruk.GenericRepository
using Buzruk.GenericRepository
// Example usage (assuming Entity Framework Core context named 'dbContext')
var repository = new GenericRepository<Product>(dbContext);
var product = await repository.GetAsync(1); // Retrieve product by ID
if (product != null)
{
product.Name = "Updated Product Name";
await repository.UpdateAsync(product); // Update the product
}
var products = await repository.GetPagedAsync(pageNumber: 2, pageSize: 10); // Retrieve products in a paged format
// ... (other methods usage)
Explore our comprehensive Wiki for in-depth guidance on usage examples, configuration options, and advanced features:
We welcome contributions to improve this repository! Here's how you can contribute:
For more detailed guidelines, please refer to our CONTRIBUTING.md file:
We maintain a detailed changelog of changes made to the package in the CHANGELOG.md file: