Package | Version | Popularity |
---|---|---|
NetDevPack |
NetDevPack is a comprehensive set of reusable classes and interfaces designed to improve development experience and productivity in .NET applications. It encapsulates best practices and common patterns such as Domain-Driven Design (DDD), CQRS, Validation, Notification, and Mediator.
If you find this project useful, please give it a star! It helps us grow and improve the community.
- ✅ Domain-driven design base classes and interfaces
- ✅ CQRS support via Mediator pattern
- ✅ FluentValidation integration
- ✅ Domain events and notifications handling
- ✅ Unit of Work and repository base contracts
Install via NuGet:
dotnet add package NetDevPack
using NetDevPack.Domain;
public class Customer : Entity
{
public string Name { get; private set; }
public Customer(Guid id, string name)
{
Id = id;
Name = name;
}
}
using NetDevPack.Data;
public interface ICustomerRepository : IRepository<Customer>
{
Task<Customer> GetByName(string name);
}
public class CustomerCommandHandler : IRequestHandler<RegisterCustomerCommand, ValidationResult>
{
private readonly IMediatorHandler _mediator;
public CustomerCommandHandler(IMediatorHandler mediator)
{
_mediator = mediator;
}
public async Task<ValidationResult> Handle(RegisterCustomerCommand request, CancellationToken cancellationToken)
{
// Business logic
await _mediator.PublishEvent(new CustomerRegisteredEvent(...));
return new ValidationResult();
}
}
using FluentValidation;
public class CustomerValidator : AbstractValidator<Customer>
{
public CustomerValidator()
{
RuleFor(c => c.Name).NotEmpty();
}
}
For a full implementation example, check Equinox Project
Supports:
- ✅ .NET Standard 2.1
- ✅ .NET 5 through 9 (including latest versions)
⚠️ Legacy support for .NET Core 3.1 and older (with limitations)
.NET DevPack was developed by Eduardo Pires under the MIT license.