Top Related Projects
ASP.NET Boilerplate - Web Application Framework
Clean Architecture Solution Template for ASP.NET Core
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
Quick Overview
Util is a comprehensive .NET Core development framework designed to simplify and accelerate application development. It provides a rich set of tools, utilities, and abstractions for common tasks, promoting best practices and clean architecture principles.
Pros
- Extensive feature set covering various aspects of application development
- Promotes clean architecture and separation of concerns
- Well-documented with detailed examples and explanations
- Active development and community support
Cons
- Steep learning curve for developers new to the framework
- May introduce unnecessary complexity for smaller projects
- Some features might be opinionated, potentially limiting flexibility in certain scenarios
Code Examples
- Dependency Injection Setup
public void ConfigureServices(IServiceCollection services) {
services.AddUtil();
}
This code sets up the Util framework's dependency injection container.
- Entity Framework Core Integration
public class OrderRepository : RepositoryBase<Order>, IOrderRepository {
public OrderRepository(IUnitOfWork unitOfWork) : base(unitOfWork) {
}
}
This example shows how to create a repository using Util's abstraction over Entity Framework Core.
- Validation
public class OrderValidator : ValidatorBase<Order> {
public OrderValidator() {
RuleFor(t => t.Id).NotEmpty();
RuleFor(t => t.CustomerId).NotEmpty();
RuleFor(t => t.OrderDate).NotEmpty();
}
}
This code demonstrates how to create a validator for an Order entity using Util's validation abstractions.
Getting Started
-
Install the Util NuGet package:
dotnet add package Util
-
Add Util to your
Startup.cs
:public void ConfigureServices(IServiceCollection services) { services.AddUtil(); }
-
Start using Util's features in your application:
public class HomeController : ControllerBase { private readonly IRepository<User> _userRepository; public HomeController(IRepository<User> userRepository) { _userRepository = userRepository; } public async Task<IActionResult> Index() { var users = await _userRepository.FindAllAsync(); return View(users); } }
This setup allows you to leverage Util's repository pattern and other features in your application.
Competitor Comparisons
ASP.NET Boilerplate - Web Application Framework
Pros of aspnetboilerplate
- More comprehensive and feature-rich framework
- Extensive documentation and community support
- Built-in multi-tenancy support
Cons of aspnetboilerplate
- Steeper learning curve due to its complexity
- Potentially heavier and more opinionated than Util
- May include unnecessary features for smaller projects
Code Comparison
aspnetboilerplate:
public class PersonAppService : AsyncCrudAppService<Person, PersonDto, int, PagedPersonResultRequestDto, CreatePersonDto, UpdatePersonDto>, IPersonAppService
{
public PersonAppService(IRepository<Person, int> repository) : base(repository)
{
}
}
Util:
public class PersonService : CrudServiceBase<Person, PersonDto, int>, IPersonService
{
public PersonService(IRepository<Person> repository) : base(repository)
{
}
}
The code comparison shows that aspnetboilerplate provides more granular control over CRUD operations with separate DTOs for different actions, while Util offers a simpler approach with a single DTO. aspnetboilerplate also includes built-in paging support in its base service.
Both frameworks aim to simplify common development tasks, but aspnetboilerplate offers a more comprehensive solution at the cost of increased complexity, while Util focuses on providing essential utilities with a lighter footprint.
Clean Architecture Solution Template for ASP.NET Core
Pros of CleanArchitecture
- Focuses on clean architecture principles, promoting separation of concerns and maintainability
- Includes a comprehensive test suite, demonstrating best practices for unit and integration testing
- Provides a clear project structure that's easy to understand and follow
Cons of CleanArchitecture
- Less extensive feature set compared to Util, which offers more built-in utilities and components
- May require more initial setup and configuration for complex applications
- Lacks some of the advanced data access and caching features found in Util
Code Comparison
CleanArchitecture:
public class CreateTodoItemCommand : IRequest<int>
{
public int ListId { get; set; }
public string Title { get; set; }
}
Util:
public class CreateOrderCommand : CommandBase<Guid>
{
public string CustomerName { get; set; }
public decimal TotalAmount { get; set; }
}
Both examples show command classes, but Util's approach extends a base command class, potentially offering more built-in functionality.
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
Pros of nopCommerce
- Full-featured e-commerce platform with a wide range of built-in functionalities
- Active community and extensive documentation
- Regular updates and long-term support
Cons of nopCommerce
- Larger codebase and potentially steeper learning curve
- Less flexibility for non-e-commerce applications
- Heavier resource requirements due to its comprehensive nature
Code Comparison
nopCommerce (Product entity):
public partial class Product : BaseEntity, ILocalizedEntity, ISlugSupported
{
public string Name { get; set; }
public string ShortDescription { get; set; }
public string FullDescription { get; set; }
public decimal Price { get; set; }
// ... more properties
}
Util (Entity base class):
public abstract class EntityBase<TKey> : IEntity<TKey>
{
public TKey Id { get; set; }
public virtual void Create() { }
public virtual void Modify() { }
// ... more methods
}
The code comparison shows that nopCommerce provides specific entities tailored for e-commerce, while Util offers a more generic approach with base classes for entity creation. nopCommerce's code is more domain-specific, whereas Util's code is designed for broader application development scenarios.
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
Pros of OrchardCore
- More comprehensive CMS framework with a modular architecture
- Larger community and ecosystem with extensive documentation
- Built-in multi-tenancy support
Cons of OrchardCore
- Steeper learning curve due to its complexity
- Potentially heavier resource usage for simpler projects
- Less flexibility for non-CMS applications
Code Comparison
OrchardCore (Startup.cs):
public void ConfigureServices(IServiceCollection services)
{
services.AddOrchardCms();
}
Util (Startup.cs):
public void ConfigureServices(IServiceCollection services)
{
services.AddUtil();
}
OrchardCore focuses on providing a full-featured CMS framework, while Util is a more general-purpose utility library for .NET Core applications. OrchardCore offers a rich set of modules and features specifically tailored for content management, whereas Util provides a collection of common utilities and extensions for various .NET Core development scenarios.
OrchardCore is better suited for projects requiring a robust CMS solution with built-in features like content management, user authentication, and theming. Util, on the other hand, is more appropriate for developers looking to enhance their .NET Core applications with additional utilities and helper functions without the overhead of a full CMS framework.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Utilåºç¨æ¡æ¶ä»ç»
ä»ä¹æ¯Utilåºç¨æ¡æ¶?
Utilæ¯ä¸ä¸ª.Netå¹³å°ä¸çåºç¨æ¡æ¶ï¼æ¨å¨æåä¸å°å¢éçå¼åè½åï¼ç±å·¥å ·ç±»ãåå±æ¶æåºç±»ãUiç»ä»¶ï¼é å¥ä»£ç çæ模æ¿ï¼æéçç»æã
Utilåºç¨æ¡æ¶çä½è : ä½éæ±
Utilåºç¨æ¡æ¶ç主è¦ä½è 为ä½éæ±ã
Utilåºç¨æ¡æ¶çå¼æºåè®®: MIT
è¿æ¯æ宽æ¾çå¼æºåè®®,æå³çå¯ä»¥ä»¥ä»»ä½æ¹å¼ä½¿ç¨è¯¥ä»£ç ã
Utilåºç¨æ¡æ¶ç主è¦è´¡ç®è
è¿éåªååºäºä¸»è¦è´¡ç®è ,è¿æå¾å¤å¼å人å以ä¸åå½¢å¼å¯¹Utilååºäºå®è´µè´¡ç®ã
Utilåºç¨æ¡æ¶çç®æ : 让å¼åæ´ç®å
Utilåºç¨æ¡æ¶è®©ä½ çå¢éè¿ éè¿å ¥ä¸å¡å¼åç¶æ,并å¨å¼åè¿ç¨ä¸æç»æä¾å¸®å©ã
Utilåºç¨æ¡æ¶çç¹ç¹: ç®åæç¨
Utilåºç¨æ¡æ¶ç设计ç念æ¯è¿½æ±Apiç®åå,å°½éå°çé ç½®,ä¸ç¨ç²¾ç¡®è®°å¿Api,æ个模ç³å°è±¡å³å¯ä½¿ç¨ã
Utilåºç¨æ¡æ¶çå¦ä¹ ææ¬ç¸å¯¹è¾ä½,对äºæ.Netåºç¡çå¼å人å,è¿è¡å¸¸è§ä¸å¡å¼å,é常å¨3天å ä¸æã
Utilåºç¨æ¡æ¶å¼åæµç¨
æé - æ´ç - éæ - å°è£
æ¯å½åç°æ æ³æ»¡è¶³é¡¹ç®éæ±æ¶ï¼æ©å±æ¡æ¶çæ¶å»æ¥ä¸´ã
ä»å¤´é è½®åæ¯ä¸çï¼æ以æ»æ¯å åå¤æéç¸å ³èµæã对äºç®åçéæ±ï¼å¯è½åªéè¦æ¾å°ä¸äºä»£ç çæå³å¯ã对äºæ´ä¸ä¸çé®é¢ï¼éè¦å¯»æ±ç¬¬ä¸æ¹ææ¯æ¡æ¶ç帮å©ã
æ¾å°è§£å³æ¹æ¡å¹¶è°è¯éè¿åï¼éè¦å¯¹ä»£ç è¿è¡æ´çï¼ä»¥ç¬¦åæ们çç¼ç¨é£æ ¼ã
é常以Nugetå æNpmå çæ¹å¼è¿è¡éæ,为äºéä½å¦ä¹ ææ¬ï¼éè¦ä»ç»èèå¦ä½å°è£ æè½è®©è°ç¨è æçåã
ä»»ä½æææ¯å«éçå·¥ä½ï¼åç±ç¬¬ä¸æ¹ææ¯æ¡æ¶å®æï¼Utilåºç¨æ¡æ¶ä» 对ææ¯æ¡æ¶éå并éæå°è£ ã
Utilåºç¨æ¡æ¶åªæ¯å¾èçä¸å±å¤è§ï¼ä¸ºå¤æçææ¯æ¡æ¶æä¾ä¸ä¸ªç®æè§å¾ã
è¿å¯¼è´æ´å¥å£®çå®ç°åæ´æç¨çAPIã
Utilåºç¨æ¡æ¶ç使ç¨æ¹å¼
使ç¨Utilåºç¨æ¡æ¶æå ç§ä¸åçæ¹å¼ã
æçµæ´»çæ¹å¼æ¯å°Utilåºç¨æ¡æ¶ç代ç å¤å¶å°ä½ èªå·±çåºç¨æ¡æ¶ä¸,ç¶åå¯ä»¥éæä¿®æ¹å®ä»¬æ¥æ»¡è¶³é¡¹ç®éæ±ã
ä¸è¿è¿ç§æ¹å¼ç代价ä¹å¾å¤§,å¾é¾å并Utilçä»»ä½æ´æ°,ä½ éè¦èªè¡ç»´æ¤ç¸å½å¤§ç代ç åºã
ç±äºUtilåºç¨æ¡æ¶çä½ç§¯å¨ä¸æå¢é¿,ç»´æ¤è¿äºä»£ç åºå¯è½ç»ä½ 带æ¥ä¸å°çè´æ ã
å¦ä¸ç§å¯è¡çæ¹å¼æ¯å°Utilåºç¨æ¡æ¶ä½ä¸ºä½ çåºç¡åº,使ç¨Nugetå¼å ¥å®ä»¬,åºç¡çå·¥ä½è®©Utilåºç¨æ¡æ¶å¸®ä½ å®æ,ä½ åªéè¦æ©å±èªå·±ä¸å¡é¢åç¸å ³çåè½ã
è¿ç§æ¹å¼çéå¶ä¹å¾ææ¾,Utilæä¾çåè½å¯è½æ æ³æ»¡è¶³ä½ çè¦æ±ã
解å³è¿ä¸ªé®é¢çå ³é®æ¯ä¸Utilå¼åå¢éä¿ææ²é,å°ä½ çéæ±åè¯æ们ã
对äºéç¨åè½,æ们ä¼å°½é满足,è¿æ ·ä¼è®©æ´å¤çå¼åè åç,对äºå®å¶éæ±,æ们ä¹ä¼ä¸ºä½ æä¾æ©å±ç¹,æ¹ä¾¿ä½ è½èªè¡æ©å±ã
æ¡æ¶æ ¸å¿
-
å¯å¨å¨
Utilåºç¨æ¡æ¶å¨é¡¹ç®å¯å¨æ¶,ä¼æ«æå ¨é¨ç¨åºé,并èªå¨æ§è¡æå¡æ³¨åå¨,æ§è¡ç¸å ³ä¾èµé ç½®.
å¯å¨å¨æ ¸å¿ä»£ç åèèª NopCommerce .
-
æå¡æ³¨åå¨
项ç®å¯å¨æ«ææ¶,ä¼å è½½ææçæå¡æ³¨åå¨,并æ顺åºæ§è¡.
æå¡æ³¨åå¨ç±»ä¼¼å ¶å®åºç¨æ¡æ¶ç模åæ¦å¿µ,ä½åè½æé.
åªè½ç¨äºé ç½®ä¾èµæ³¨å ¥å ³ç³»,æ æ³è·åæå¡æä¾ç¨åº,æ以ä¸è½æ§è¡å¤æçæä½.
-
ä¾èµæ³¨åå¨
æ«æ ISingletonDependency, IScopeDependency, ITransientDependency æ¥å£,并èªå¨é ç½®ä¾èµ.
æ¡æ¶åºç¡
-
对象å°å¯¹è±¡æ å°
ææ¯éå: AutoMapper.
对象å°å¯¹è±¡æ å°ä¸»è¦ç¨äºåå±å¯¹è±¡ä¹é´ç转æ¢,æ¯å¦ä»å®ä½æ å°å°DTO.
Util å¨ææ对象ä¸æ·»å MapTo æ©å±æ¹æ³,èªå¨å®æåºç¡é ç½®,å¦ææ å°ç两端对象å±æ§åç¸å,åæ éé ç½®,ç´æ¥ä½¿ç¨å³å¯.
-
AOP( é¢ååé¢ç¼ç¨ )
ææ¯éå: AspectCore.
AOPç¨äºå¨è°ç¨æ¹æ³æ¶è¿è¡æ¦æª,å¨æ§è¡ååæ·»å èªå®ä¹é»è¾.
Util 主è¦ä½¿ç¨AOPæ¦æªå¨è¿è¡éªè¯.
-
对象éªè¯
Util ä½¿ç¨ DataAnnotation 注解ä½ä¸ºåºç¡éªè¯æ¹å¼,并æä¾ éªè¯è§å å éªè¯å¤çå¨ çæé åè¿è¡èªå®ä¹éªè¯åå¤ç.
Util å¨å®ä½,DTOç对象ä¸æ·»å äº Validate æ¹æ³, 以æ ååçæ¹å¼è¿è¡å¯¹è±¡éªè¯.
-
å¼å¸¸å¤ç
Util æä¾äº Warning ç±»å,表示ä¸å¡å¼å¸¸,并å°è£ ç¸å ³å¼å¸¸æä½.
-
身份认è¯åææ
ææ¯éå: Identity, Identity Server 4
Identity æ¯Asp.Net Coreèªå¸¦ç身份认è¯æ¡æ¶,æä¾ç¨æ·ç®¡ç,ç»å½è®¤è¯çåè½.
Identity Server 4 æ¯ä¸ä¸ªèº«ä»½è®¤è¯æå¡å¨,ç¨äºé¢å令çåéªè¯ä»¤ççæä½.
Identity Server 4 å·²ç»åæ¢æ´æ°,å®çæ°çæ¬æ¯æ¶è´¹ç,Util ä» ä½¿ç¨ Identity Server 4 çåºç¡åè½,ç±äºå®çåºç¡åè½å·²ç»åå稳å®,ææ¶ä¸éè¦è¿ç§»å°å ¶å®æ¡æ¶.
Util é¤äºéæ Identity å Identity Server 4,è¿æ©å±äºAsp.Net Coreèªå®ä¹ææçç¥,æä¾ç®åæè¡çApi访é®æ§å¶æ¹æ³.
Util Platformæä¾äºåºäºè§è²åèµæºçæé管çåè½,å¯ä»¥è½»æ¾è®¾ç½®å端UIèååæé®çæé,åæ¶å¯¹å端APIè¿è¡è®¿é®æ§å¶.
-
æ¬å°å
ææ¯éå: My.Extensions.Localization.Json
Util æ¬å°åæ¯æJsonæ件æèªå®ä¹æ°æ®åå¨æ¹å¼.
My.Extensions.Localization.Json æä¾äºJsonæ¬å°ååè½.
ç±äºæ æ³æ»¡è¶³é¡¹ç®éæ±, 以æºç æ¹å¼å¼å ¥, 对å¥å£®æ§åæ§è½è¿è¡äºæå.
-
æ¥å¿
ææ¯éå: Serilog, Seq, Exceptionless
Serilogæ¯.Netç®åææµè¡çæ¥å¿æ¡æ¶,æ¯æç»æåæ¥å¿.
Seq å Exceptionless æ¯æ¥å¿ç®¡çç³»ç»,æä¾äºæä½æ¥å¿ççé¢,å¯ä»¥ä½¿ç¨Serilogåå ¥.
Util 对å®ä»¬è¿è¡äºè½»åº¦å°è£ ,éæäºå¸¸ç¨é ç½®,并æä¾æ¥å¿ä¸ä¸æçæ©å±.
-
ç¼å
ææ¯éå: EasyCaching
Util éæäºå åç¼ååRedisç¼å两ç§æä¾ç¨åº.
-
äºä»¶æ»çº¿
äºä»¶æ»çº¿å为æ¬å°äºä»¶æ»çº¿åéæäºä»¶æ»çº¿.
Util æ¬å°äºä»¶æ»çº¿æä¾ä¸¤ç§å®ç°,é»è®¤ä½¿ç¨Iocæ¹å¼å®ç°,æ éå¤é¨ä¾èµ. å¦å¤å¼å ¥äº MediatR æ¡æ¶,å®æ¯æµè¡çè¿ç¨å äºä»¶å¤çæ¡æ¶.
éæäºä»¶æ»çº¿ç¨äºå¾®æå¡ä¹é´æ¶æ¯éä¿¡,Util éæäº Dapr å¾®æå¡æ¡æ¶,åºäº Dapr çåå¸è®¢é å®ç°éæäºä»¶æ»çº¿.
-
模æ¿å¼æ
ææ¯éå: RazorEngineCore , Handlebars.Net
Util 以æºç æ¹å¼å¼å ¥ RazorEngineCore ,并è¿è¡å¤§éä¿®æ¹.
Razor 模æ¿å¼æç®å主è¦ç¨å¨ Util 代ç çæå¨.
-
å¾åå¤ç
ææ¯éå: ImageSharp
ImageSharp æ¯ä¸ä¸ªå¾åå¤çåº.
Util ä½¿ç¨ ImageSharp å®ç°å¨æææ¬å¤´åçæ.
-
æ件åå¨
ææ¯éå: Minio
Minio æ¯æµè¡ç对象åå¨ç³»ç»,éåé¨ç½²å°å é¨æå¡å¨.
Util éæå°è£ äº Minio SDK, æä¾ åå¨æ¡¶å称å¤ççç¥, æ件åå¤ççç¥çæé åè¿è¡æ©å±å¤ç.
-
åå°ä»»å¡
ææ¯éå: Quartz , HangFire
Util å°è£ äº Quartz å HangFire, ç¨äºå¤çåå°ä»»å¡.
-
æ°æ®è®¿é®
ææ¯éå: EntityFrameworkCore , Dapper
Utilæ°æ®è®¿é®ä¸»è¦ä½¿ç¨ EntityFrameworkCore ,å®æ¯.Netå®æ¹æä¾çORMæ¡æ¶,å±äºéé级æ°æ®è®¿é®æ¡æ¶.
EntityFrameworkCore æ¯æå·¥ä½åå 模å¼,对å¤æçä¸å¡å¤çé常ææ,ä½å¯¹å¤æçæ¥è¯¢æä½æ è½ä¸ºå.
å¯ä»¥ç´æ¥ä½¿ç¨ EntityFrameworkCore æ§è¡Sqlè¯å¥, ä½æ¤æä½é常åå§,æçä½ä¸.
Dapperæ¯è½»é级æ°æ®è®¿é®æ¡æ¶, Utilå¼å ¥å®å¹¶è¿è¡å°è£ ,ç¨äºè§£å³æ¥è¯¢é®é¢.
ç®å Util Dapper å°è£ å°ä¸å¯ç¨,å®è¿ç¼ºä¹å页,Lambda表达å¼æ¯æçé«çº§åè½,ç°å¨ä» ç¨äºä»£ç çæ读åå æ°æ®,åç»ä¼è¿è¡æ©å±.
ç±äºä½¿ç¨å½äº§æ°æ®åºçéæ±éæ¸å¢å¤,åç»å°èèå¼å ¥ FreeSql æ°æ®è®¿é®æ¡æ¶.
-
å·¥å ·ç±»
Utilå å«å¤§éå·¥å ·ç±»,ç¨äºå¤ç常ç¨æä½.
- ç±»å转æ¢æä½
- Lambdaæä½
- å½ä»¤è¡æä½
- é ç½®æä½
- æ举æä½
- Iocæä½
- Jsonæä½
- å符串æä½
- æ¶é´æä½
- IPæä½
- Webæä½
- å å¯æä½
- ...
æ¶ææ¯æ
å¤ç§æ·æ¶ææ¯æ
Saasç³»ç»æ¯æå¤å®¶å®¢æ·ä½¿ç¨åä¸ç³»ç»,客æ·æ°æ®å½¼æ¤é离.
Util åèäº ABP åºç¨æ¡æ¶çå¤ç§æ·æ¶æ设计çç§æ·è§£æåæ°æ®è¿æ»¤é¨å.
Util å¤ç§æ·æ¶æå¨ç¬ç«é¨ç½²ç§æ·æ°æ®åºæ¹é¢åºäº EntityFrameworkCore çå®æ¹å»ºè®®,æä¸äºéå¶.
DDDåå±æ¶ææ¯æ
Util åå±æ¶æåºäºé¢å驱å¨è®¾è®¡(DDD) å ä¼ä¸åºç¨æ¶æ模å¼(POEAA) çåºç¡æé å.
.Net æ©ææµè¡çåå±æ¶ææ¯ä¸å±æ¶æ, 对äºä¸çæ DDD çå¼å人å,å¯ä»¥æå®å½æä¸å±æ¶æ使ç¨,ä¸è¿æ¯è¯çååèå·².
ä½æ¯å¯¹äºæä¸å®é¢å模å使ç¨ç»éªçå¼å人å,该æ¶æå¨å¤çæ´å¤æçä¸å¡æ¶å¯ä»¥ææ管æ§å¤ææ§.
对äºå¤æ模åçå¼å,该æ¶æä¸ä¸å±æ¶æç主è¦åºå«å¨äº,å®ä½æ¯ä½ä¸ºç®åæ°æ®å®¹å¨,è¿æ¯ä½ä¸ºä¸å¡å¤ççåºæ.
对äºå¾å¤ä¸å¡é¢å,å°å®ä½å¯¹åºçä¸å¡æä½å°è£ å°å®ä½æ¬èº«,å¯ä»¥æåä¸å¡è¡¨è¾¾è½ååå°è£ æ§.
Util åå±æ¶æå为åå±.
é¢åå±
é¢åå±æ¯Utilåå±æ¶æçæ ¸å¿.
é¢åå±é常纯å, 没æ对æ°æ®è®¿é®åUIçä¾èµ,å¾å®¹æ对该å±è¿è¡åå æµè¯.
-
èåæ ¹
ä½ä¸ºå¹¶ååå çæå¤å±å®ä½.
-
å®ä½
ç±å¯ä¸æ è¯å³å®çä¸å¡å¯¹è±¡.
-
å¼å¯¹è±¡
表示å®ä½å±æ§å¼ç对象.
-
ä»å¨
表示èåæ ¹çéå,ç¨äºè¿è¡æ°æ®è®¿é®.
-
é¢åæå¡
ç¨äºå°è£ å¤ä¸ªèåæ ¹çæä½.
-
é¢åäºä»¶
表示å®ä½æ°æ®åçåå.
使ç¨Utilæ¬å°äºä»¶æ»çº¿åå¸é¢åäºä»¶.
æå 个æ åé¢åäºä»¶:
- EntityChangedEvent - å®ä½åæ´äºä»¶
- EntityCreatedEvent - å®ä½å建äºä»¶
- EntityUpdatedEvent - å®ä½ä¿®æ¹äºä»¶
- EntityDeletedEvent - å®ä½å é¤äºä»¶
åºç¡è®¾æ½å±
对äºå¤§å¤é¡¹ç®,åºç¡è®¾æ½å±ä¸»è¦å å«æ°æ®è®¿é®çå®ç°.
åºç¨å±
éæäºé¢åå±ååºç¡è®¾æ½å±,为UIæä¾æå¡.
-
åºç¨æå¡
åºç¨æå¡æ¥æ¶UI请æ±,并å°è°ç¨å§æç»å®ä½,é¢åæå¡çæé åå®æä¸å¡åè½.
对äºæ®é项ç®,ä¸å¡é»è¾ç´æ¥å¨åºç¨æå¡ä¸å®ç°å³å¯,è¿ä¸ä¸å±æ¶æç¸ä¼¼.
-
æ°æ®ä¼ è¾å¯¹è±¡(DTO)
æ°æ®ä¼ è¾å¯¹è±¡æ¯ä¸ç§ç¨æ¥ä¼ éåæ°ç对象.
-
æ¥è¯¢åæ°å¯¹è±¡
æ¥è¯¢åæ°å¯¹è±¡æ¯ä¸ç§ä¸é¨ç¨æ¥ä¼ éæ¥è¯¢åæ°ç对象.
表ç°å±
å¾®æå¡æ¶ææ¯æ
Util éæäº Dapr ,å®æ¯å¾®è½¯ä¸»æ¨çå¾®æå¡æ¡æ¶.
Util å°è£ äº Dapr Httpåæ¥è°ç¨,å¼æ¥äºä»¶åå¸è®¢é ,ç¶æåå¨çåè½.
并对身份认è¯,äºä»¶æ¥å¿,äºä»¶éåçéè¦åè½è¿è¡æ©å±.
常è§ä¸å¡åè½æ¯æ
æ å½¢ç»ææ¯æ
æäºæ°æ®å å«å±æ¬¡ç»æ.
Util åå±æ¶æå å«å¯¹æ å½¢ç»æçæ¯æ.
å¦æä½¿ç¨ Util UI,æ 论å è½½æ å½¢è¡¨æ ¼è¿æ¯æ å½¢,继æ¿åºç±»å³å¯å®ç°åè½.
审计æ¯æ
大å¤æä½éè¦è®°å½å建人,å建æ¶é´,ä¿®æ¹äºº,ä¿®æ¹æ¶é´ç审计信æ¯.
Utilæ¯æä¿åæ¶èªå¨è®¾ç½®å®¡è®¡ä¿¡æ¯.
Util 审计设计åèèª ABP åºç¨æ¡æ¶.
é»è¾å é¤æ¯æ
Util æ¯æé»è¾å é¤,å é¤æ¶æ´æ°ä¸ºå·²å é¤ç¶æ,æ¥è¯¢æ¶èªå¨è¿æ»¤å·²å é¤è®°å½.
Util é»è¾å é¤è®¾è®¡åèèª ABP åºç¨æ¡æ¶.
对象åæ´å¼æ¯æ
ä¿®æ¹æ¶å¯è½éè¦è·å对象åªäºæ°æ®åçäºåå.
Util æä¾å¤ç§æ¹å¼è·å对象åæ´å¼è®°å½.
代ç çæ
ç±äº Util éç¨ DDDåå±æ¶æ,导è´ç®åéæ±ä¹éè¦å建大éçç±»å.
æå·¥å建è¿äºç±»åæçä½ä¸,éè¿ä»£ç çæè¿ éå建å®ä»¬,å¯ä»¥å¤§å¹ æåå¼åæçåè´¨é.
Util é å¥ä»£ç çæå¨, ç®åæç¨, å¯è§£å³å¤§é¨åæºæ¢°å·¥ä½.
å¨çæç代ç åºç¡ä¸è¿è¡ä¿®æ¹,æ¯ä»å¤´å¼å§å·¥ä½è¦å¥½å¾å¤.
UI ææ¯éå
-
Jsè¯è¨
-
TypeScript
TypeScript æ¯ å¾®è½¯å¼åçèæ¬è¯è¨, æ©å±äºå¼±ç±»åç Javascript,æä¾å¢å¼ºçè¯æ³å强类åæ¯æ.
为ç¼è¾å¨ä»£ç æ示åè¯æ³é误æ£æµå¥ å®åå®åºç¡.
-
-
Jsæ¡æ¶
-
Angular
Angular æ¯ Googleå¼åç Jsæ¡æ¶.
Angularä½¿ç¨ TypeScript èæ¬è¯è¨å¼å, 并éç¨ RxJs ååºå¼ç¼ç¨æ¡æ¶.
Angular æ¯å端Jsä¸å¤§æ¡æ¶ä¹ä¸,å¦å¤ä¸¤ä¸ªæ¯ Vue å React.
Util UI ç¨äºå¼å管çåå°,éæ© Angular æ¯å 为å®çè¯æ³æä¼é , ä¹æ符åå端å¼å人åçä¹ æ¯.
-
-
Angular ç»ä»¶åº
-
Ng Zorro
Ng Zorro æ¯é¿é Ant Design ç Angular çæ¬,æä¾ 80+ 常ç¨ç»ä»¶,è¦ç大é¨åä¸å¡å¼ååºæ¯.
-
Ng Alain
è½ç¶ Ng Zorro æä¾äºå¤§é常ç¨ç»ä»¶,ä½é¡¹ç®å¼åéè¦ä¸ä¸ªéæ度æ´é«çç¯å¢.
Ng Alain æ¯ä¸ä¸ªåºæ¶é¡¹ç®, éæäº Ng Zorro ç»ä»¶,æä¾ä¸å¡å¼åç项ç®æ¨¡æ¿,é¤äºèå导èªçæ¡æ¶å ç´ ,è¿æå¾å¤å¼ç®±å³ç¨çä¸å¡å¤ç页é¢æ¨¡æ¿.
-
-
Angular å¾®å端æ¡æ¶
-
Angular Module Federation
å¦æä½ ç项ç®å å«å¤§é Angular 模å,æææ件å¨åä¸ä¸ªé¡¹ç®ä¸,ä¼å¯¼è´å¼åç¯å¢å¡é¡¿åç¼æ ¢.
åå¸é¡¹ç®ä¹å¯è½éè¦å¾é¿æ¶é´.
å¦å¤,å¦ææ个模åéè¦è¿è¡ä¿®æ¹,åªæåªä¿®æ¹ä¸è¡ä»£ç ,ä¹éè¦å¯¹ææ模åéæ°åå¸.
ä¸å端çå¾®æå¡ç±»ä¼¼,å¾®å端æ¯å端ç项ç®æåæ¹æ³.
å¾®å端å°ä¸åç Angular 模åæåå°ä¸å项ç®ä¸,å¯ä»¥ç¬ç«å¼å,ç¬ç«æµè¯åç¬ç«é¨ç½².
æ è®ºä½ æ¯å¦ä½¿ç¨å¾®æå¡æ¶æ,åå¯ä½¿ç¨å¾®å端æåæ¹å¼.
Angular Module Federation æ¯åºäºWebpack模åèåçAngularå¾®å端解å³æ¹æ¡.
-
Util Angular UI ç¹ç¹
-
ç»ä»¶æ©å±æ¯æ
é¤äºæ¯æ Ng Zorro åçåè½å¤,Util UIè¿å¯¹å¸¸ç¨ç»ä»¶è¿è¡äºæ©å±.
æéè¦çæ©å±æ¯æ¯æ常ç¨ç»ä»¶ç´æ¥ååº Api 请æ±,èä¸ç¨å®ä¹é¢å¤çæå¡.
-
Razor TagHelper æ¯æ
Util Angular UIä¸ä» å¯ä»¥ä½¿ç¨ html 页é¢,è¿è½ä½¿ç¨ .Net Razor 页é¢.
Razor 页é¢å¯ä»¥ä½¿ç¨ TagHelper æå¡ç«¯æ ç¾.
Util å·²å°å¤§é¨å Ng Zorro ç»ä»¶å°è£ 为 TagHelper æ ç¾.
é¤äºè·å¾å¼ºç±»åæ示å¤,TagHelper ä½ä¸ºæ½è±¡å±,æä¾æ´ç®æ´çæ ç¾è¯æ³.
å¦ä¸ä¸ªå¼ºå¤§ä¹å¤å¨äºLambda表达å¼æ¯æ, å¯ä»¥å°DTOç´æ¥ç»å®å° TagHelper æ ç¾ä¸.
è½å¤ä»Lambda表达å¼æåå æ°æ®,并èªå¨è®¾ç½®å¤§é常ç¨å±æ§,æ¯å¦name,éªè¯,模åç»å®ç.
-
ååå离
ä¸äºå¼å人åçå° Util Angular UI ä½¿ç¨ .Net Razor 页é¢,å¯è½è®¤ä¸º UI ä¸ .Net é«åº¦è¦å,ä½ç°å¨çè¶å¿æ¯ååå离.
æè°ååå离,æ¯å端UIåå端API没æä¾èµ,æ´æ¢æä¸ç«¯å¯¹å¦ä¸ç«¯æ²¡æå½±å.
å¦å¤,ååå离å,å端UIåå端APIå¯ä»¥ç±ä¸åçå¼å人åå®æ.
.Net Razor页é¢ä» å¨å¼åé¶æ®µæä¾å¸®å©,å¨åå¸æ¶, Razor 页é¢ä¼è½¬æ¢ä¸º html ,åç»åå¸æµç¨ä¸çº¯å端å¼åæ¹å¼ç¸å.
ä¸æ¦åå¸æå,å°å®å ¨è±ç¦».Net ç¯å¢,å¯ä»¥ä½¿ç¨ Nginx 容å¨æ¿è½½å®.
åå¸åç产ç©,ä¸ä½ 使ç¨çº¯å端æ¹å¼å¼åæå 没æåºå«.
å¦æä½ å欢,å¯ä»¥æå端APIæ¢æJAVA,ä¹è½æ£å¸¸è¿è¡.
-
é å¥Apiæ¯æ
å端UIåå端APIçå¼åæ¯ä¸¤ä¸ªå®å ¨ä¸åçé¢å.
ä½å¼åä¸ä¸ªåè½,åéè¦å端åå端çé å,ä»ä»¬éè¦æ²é,ä½åºä¸äºçº¦å®.
对äºé åä¸å°ä½çå¢é,åå端çæ²éææ¬å¯è½å¾é«,å¦å¤æä¾çAPIå¯è½æ æ³æ»¡è¶³UIçéæ±,ä»è让å端代ç åå¾ç¸å½¢.
é常.Netå¼å人åçJsç¼ç¨ååºé«äºå¸¸è§å端人å,å端人åæ´æ é¿æ ·å¼å¸å±.
Util Angular UI ä¸ä» æä¾å¯¹å端ç»ä»¶çå°è£ ,åæ¶ä¹ä¸ºå¸¸è§åè½æä¾ Api æ¯æ.
对äºä½¿ç¨ Util Angular UI çå¢é, å° UI å API 交ç»åä¸ä¸ª.Netå¼å人åå°±æ¯æ好çéæ©.
å端人åä» è°æ´çé¢æ ·å¼å³å¯.
ä¸ä» åå°äºæ²éææ¬, APIåå端ç»ä»¶çé«åº¦éæå°è£ ,让常è§åè½çå¼åæçå¾å°å¤§å¹ æå.
å½ç¶,è¿å¯¹ .Net å¼å人åçæ°´å¹³æä¸å®è¦æ±.
-
æ¬å°åæ¯æ
å¾çäº Ng Alain æ¬å°åçè¯å¥½è®¾è®¡, å¯ä»¥ä½¿ç¨ i18n 管éè¿è¡ææ¬çæ¬å°å转æ¢.
'ææ¬' | i18n
ä¸è¿å¯¹äºéè¦æ¯ææ¬å°åç项ç®,è¿ä¾ç¶æ¯ä¸ä¸ªè´æ ,æ¯ä¸ªè¡¨å项,æ¯ä¸ªè¡¨æ ¼é¡¹,æ¯ä¸ªææ¬,å¯è½é½éè¦æ·»å i18n 管é.
Util Angular UI 让æ¬å°åå¼åæ´è¿ä¸æ¥,对大é¨åç»ä»¶æä¾äºæ¬å°åæ¯æ,åªææå°æ°ææ¬éè¦æ工添å i18n 管é.
-
ææ访é®æ¯æ
Ng Alainæä¾äºææ访é®çæ¯æ.
Util Platformæé模ååºäºèµæºåè§è²ç设计,å¯ä»¥å¾å¥½çä¸ Ng Alainææè¿è¡éæ.
ä½ å¯ä»¥æ§å¶èååä»»æåºåæ ¹æ®æéæ¾ç¤ºåéè.
-
å¾®å端æ¯æ
Util Angular UI å¼å ¥äº Angular Module Federation , è½å¤å° Angular 模åæåå°ä¸å项ç®ä¸,å¯ä»¥ç¬ç«å¼å,ç¬ç«æµè¯åç¬ç«é¨ç½².
对äºå¤§ä¸å项ç®,è¿æ¯é常æå¿ è¦ç.
Util Angular UI åè½å表
Util Angular UI 主è¦ç± util-angular å Util.Ui.NgZorro 两个åºæä¾æ¯æ.
-
util-angular åè½å表
util-angular æ¯ä¸ä¸ª Js åº, ç±Curdç»ä»¶åºç±», Ng Zorro常ç¨ç»ä»¶æ©å±æ令åä¸ç»å·¥å ·ç±»ç»æ.
-
åºç¡ç±»å
- ViewModel - è§å¾æ¨¡ååºç±»
- TreeViewModel - æ å½¢è§å¾æ¨¡ååºç±»
- TreeNode - æ å½¢èç¹åºç±»
- PageList - å页å表
- QueryParameter - æ¥è¯¢åæ°åºç±»
- TreeQueryParameter - æ å½¢æ¥è¯¢åæ°åºç±»
- Result - æå¡ç«¯è¿åç»æ
- StateCode - æå¡ç«¯ç¶æç 约å®
- SelectItem - å表项
- SelectList - å表
- SelectOptionGroup - å表é ç½®ç»
- SelectOption - å表é 置项
-
å·¥å ·ç±»
- æµè§å¨æ¬å°åå¨æä½
- Cookieæä½
- äºä»¶æ»çº¿æä½
- æ¬å°åæä½
- Iocæä½
- å è½½æä½
- è·¯ç±æä½
- å¼¹åºå±æä½
- æ½å±æä½
- 表åæä½
- Httpæä½
- Web Apiæä½
- æ¶æ¯æä½
- ...
-
Crudç»ä»¶åºç±»
- ç¼è¾ç»ä»¶åºç±»
- è¡¨æ ¼ç¼è¾ç»ä»¶åºç±»
- æ å½¢ç¼è¾ç»ä»¶åºç±»
- æ¥è¯¢ç»ä»¶åºç±»
- è¡¨æ ¼æ¥è¯¢ç»ä»¶åºç±»
- æ å½¢è¡¨æ ¼æ¥è¯¢ç»ä»¶åºç±»
-
Ng Zorroæ令æ©å±
- å¿ å¡«é¡¹éªè¯æ©å±æ令
- éªè¯æ¶æ¯æ©å±æ令
- Ng Zorro æé®æ©å±æ令
- Ng Zorro éæ©æ¡æ©å±æ令
- Ng Zorro è¡¨æ ¼æ©å±æ令
- Ng Zorro è¡¨æ ¼ç¼è¾æ©å±æ令
- Ng Zorro æ å½¢è¡¨æ ¼æ©å±æ令
- Ng Zorro æ å½¢æ©å±æ令
- Ng Zorro ä¸ä¼ æ©å±æ令
-
-
Util.Ui.NgZorro åºä»ç»
Util.Ui.NgZorro æ¯ä¸ä¸ª C# ç±»åº,å å« TagHelperæ ç¾åæ å½¢æ§å¶å¨çç±»å.
ç»å¤§é¨å Ng Zorro ç»ä»¶å·²ç»å°è£ .
ç±äºç»ä»¶å¾å¤,å°±ä¸ä¸ä¸ååº.
Util Angular UI å·²ç¥ç¼ºé·
Util Angular UI ææå·²ç¥ç¼ºé·å已解å³.
Util Angular UI éåä½ å?
Util Angular UI æ¯ä¸º .Net å ¨æ å·¥ç¨å¸åå¤ç,å¦æä½ å欢æ´ç®æ´çè¯æ³,å¸æå¼åçææ¬æ´ä½,å®å°±éåä½ .
åèåºç¨æ¡æ¶
å¾ææ¾,éé¨é 车ä¸å¯åã
Utilåºç¨æ¡æ¶å¤§é¨åä¾èµä»¥Nugetæ¹å¼å¼å ¥,æå°é¨åéè¦ä¿®æ¹æºç ,å以å¤å¶æºç æ¹å¼ä½¿ç¨ã
å¦å¤,.Netåºç¨æ¡æ¶è¿æå¾å¤ä¼ç§çå¼æºé¡¹ç®,ä»ä¸å¦ä¹ åå¸åå »åæ¯Utilæé¿çå ³é®ã
Utilåºç¨æ¡æ¶ä¸»è¦åèäºä»¥ä¸å¼æºé¡¹ç®,ä»ä¸å¸æ¶æ¶æå代ç ,并以Utilé£æ ¼è¿è¡æ´çã
Utilåºç¨æ¡æ¶ç¸å ³èµæº
Utilæç¨ç®å½
Github项ç®å°å
-
Util https://github.com/dotnetcore/Util
该项ç®å å«Utilåºç¨æ¡æ¶å ¨é¨æºç ã
-
Util.Generator https://github.com/util-core/Util.Generator
该项ç®æä¾Util代ç çæ模æ¿,帮å©ä½ è¿ éå建ä¸å¡é¡¹ç®åºæ¶ã
-
util-angular https://github.com/util-core/util-angular
该项ç®æ¯å¯¹angular,ng zorro,ng alainå端æ¡æ¶çäºæ¬¡å°è£ Jsåº,ä¸Util.Ui.NgZorroç±»åºé å使ç¨ã
-
Util.Platform.Single https://github.com/util-core/Util.Platform.Single
使ç¨æ°çåºç¨æ¡æ¶éå¸¸å ·æé«æçææ¬,为帮å©ä½ åè½»åå§è´æ ,该项ç®æä¾ä¸äºå¸¸ç¨ä¸å¡åè½,ä½ å¯ä»¥å°å®ä½ä¸ºé¡¹ç®èµ·ç¹ã
ç®åæä¾äºæé管ç模å,å¯ä»¥æ§å¶å°èååæé®,并è½åºäºè§è²èµæºå¯¹APIè¿è¡è®¿é®æ§å¶,åç»å°ä¸æå®åå ¶å®å¸¸ç¨åè½ã
该项ç®æä¾åä½åå¾®æå¡ä¸¤ä¸ªçæ¬,Util.Platform.Singleæ¯åä½çæ¬ã
-
Util.Platform.Dapr https://github.com/util-core/Util.Platform.Dapr
å®æ¯Util Platformçå¾®æå¡çæ¬,éç¨Daprå¾®æå¡æ¡æ¶,项ç®ç»æåèèªeShopOnDaprã
-
Util.Platform.Share https://github.com/util-core/Util.Platform.Share
å å«Util.Platform.SingleåUtil.Platform.Daprçå ±äº«ä»£ç ,并åå¸å°Nuget,ä¾ä¸¤ä¸ªçæ¬ä½¿ç¨ã
Gitee项ç®å°å
ç±äºå½å 访é®Githubé常ç¼æ ¢,ç°å¨Utilææ项ç®åå¸æ¶ä¼å¨Giteeè¿è¡åæ¥æ´æ°ã
- Util https://gitee.com/util-core/util
- Util.Generator https://gitee.com/util-core/Util.Generator
- util-angular https://gitee.com/util-core/util-angular
- Util.Platform.Single https://gitee.com/util-core/Util.Platform.Single
- Util.Platform.Dapr https://gitee.com/util-core/Util.Platform.Dapr
- Util.Platform.Share https://gitee.com/util-core/Util.Platform.Share
Nugetå
å å | çæ¬ | ä¸è½½é |
---|---|---|
Util.Core | ||
Util.ObjectMapping.AutoMapper | ||
Util.Aop.AspectCore | ||
Util.Validation | ||
Util.Security | ||
Util.Data.Abstractions | ||
Util.AspNetCore | ||
Util.Localization | ||
Util.Logging | ||
Util.Logging.Serilog | ||
Util.Logging.Serilog.Exceptionless | ||
Util.Events.Abstractions | ||
Util.Events | ||
Util.Events.MediatR | ||
Util.Templates | ||
Util.Templates.Razor | ||
Util.Templates.Handlebars | ||
Util.Caching | ||
Util.Caching.EasyCaching | ||
Util.Scheduling | ||
Util.Scheduling.Quartz | ||
Util.Scheduling.Hangfire | ||
Util.Images.ImageSharp | ||
Util.Images.Avatar | ||
Util.FileStorage.Abstractions | ||
Util.FileStorage | ||
Util.FileStorage.Minio | ||
Util.FileStorage.Aliyun | ||
Util.FileStorage.All | ||
Util.Tenants.Abstractions | ||
Util.Tenants | ||
Util.Domain | ||
Util.Domain.Biz | ||
Util.Data.Core | ||
Util.Data.Sql | ||
Util.Data.Metadata | ||
Util.Data.EntityFrameworkCore | ||
Util.Data.EntityFrameworkCore.SqlServer | ||
Util.Data.EntityFrameworkCore.PostgreSql | ||
Util.Data.EntityFrameworkCore.MySql | ||
Util.Data.EntityFrameworkCore.Sqlite | ||
Util.Data.EntityFrameworkCore.Oracle | ||
Util.Data.Dapper.Core | ||
Util.Data.Dapper.SqlServer | ||
Util.Data.Dapper.PostgreSql | ||
Util.Data.Dapper.MySql | ||
Util.Data.Dapper.All | ||
Util.Application | ||
Util.Application.EntityFrameworkCore | ||
Util.Application.WebApi | ||
Util.Microservices | ||
Util.Microservices.Polly | ||
Util.Microservices.Dapr | ||
Util.Microservices.HealthChecks | ||
Util.Ui | ||
Util.Ui.Angular | ||
Util.Ui.NgZorro | ||
Util.Ui.NgAlain | ||
Util.Generators | ||
Util.Generators.Razor |
Npmå
Top Related Projects
ASP.NET Boilerplate - Web Application Framework
Clean Architecture Solution Template for ASP.NET Core
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot