public async Task <Unit> Handle(UpdateRoleCommand request, CancellationToken cancellationToken) { await _roleDomainEntity.GetAsync(request.Id, cancellationToken); _roleDomainEntity.MapFrom(request, _mapper); await _roleDomainEntity.UpdateAsync(cancellationToken); return(Unit.Value); }
public async Task <CreateRoleResponse> Handle(CreateRoleCommand request, CancellationToken cancellationToken) { await _roleDomainEntity.NewAsync(cancellationToken); _roleDomainEntity.MapFrom(request, _mapper); await _roleDomainEntity.CreateAsync(cancellationToken); return(new CreateRoleResponse { Id = _roleDomainEntity.EntityId }); }