Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A smart set of common classes and implementations to improve your development productivity.

License

NotificationsYou must be signed in to change notification settings

NetDevPack/NetDevPack

Repository files navigation

.NET DevPack

PackageVersionPopularity
NetDevPackNuGetNuget

What is the .NET DevPack?

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.

Give a Star! ⭐

If you find this project useful, please give it a star! It helps us grow and improve the community.

Features

  • ✅ 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

Installation

Install via NuGet:

dotnet add package NetDevPack

Basic Usage

Domain Entity

usingNetDevPack.Domain;publicclassCustomer:Entity{publicstringName{get;privateset;}publicCustomer(Guidid,stringname){Id=id;Name=name;}}

Repository Interface

usingNetDevPack.Data;publicinterfaceICustomerRepository:IRepository<Customer>{Task<Customer>GetByName(stringname);}

Using the Mediator

publicclassCustomerCommandHandler:IRequestHandler<RegisterCustomerCommand,ValidationResult>{privatereadonlyIMediatorHandler_mediator;publicCustomerCommandHandler(IMediatorHandlermediator){_mediator=mediator;}publicasyncTask<ValidationResult>Handle(RegisterCustomerCommandrequest,CancellationTokencancellationToken){// Business logicawait_mediator.PublishEvent(newCustomerRegisteredEvent(...));returnnewValidationResult();}}

Fluent Validation

usingFluentValidation;publicclassCustomerValidator:AbstractValidator<Customer>{publicCustomerValidator(){RuleFor(c=>c.Name).NotEmpty();}}

Example

For a full implementation example, checkEquinox Project

Compatibility

Supports:

  • ✅ .NET Standard 2.1
  • ✅ .NET 5 through 9 (including latest versions)
  • ⚠️ Legacy support for .NET Core 3.1 and older (with limitations)

About

.NET DevPack was developed byEduardo Pires under theMIT license.


[8]ページ先頭

©2009-2025 Movatter.jp