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.
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 DevPack was developed by Eduardo Pires under the MIT license.