chore: add documentation comments and stylecop rules
This commit is contained in:
@@ -17,7 +17,10 @@ public sealed class CreateRoleCommandHandler(
|
||||
{
|
||||
public async Task<RoleDto> Handle(CreateRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
// 1. 获取租户上下文
|
||||
var tenantId = tenantProvider.GetCurrentTenantId();
|
||||
|
||||
// 2. 构建角色实体
|
||||
var role = new Role
|
||||
{
|
||||
TenantId = tenantId,
|
||||
@@ -26,9 +29,11 @@ public sealed class CreateRoleCommandHandler(
|
||||
Description = request.Description
|
||||
};
|
||||
|
||||
// 3. 持久化
|
||||
await roleRepository.AddAsync(role, cancellationToken);
|
||||
await roleRepository.SaveChangesAsync(cancellationToken);
|
||||
|
||||
// 4. 返回 DTO
|
||||
return new RoleDto
|
||||
{
|
||||
Id = role.Id,
|
||||
|
||||
Reference in New Issue
Block a user