public async Task <Response> Handle(Request request, CancellationToken cancellationToken) { var role = await _roleReadRepository.GetAsync(request.Id); if (role == null) { var response = new Response(); response.AddError($"Role de id {request.Id} não encontrado"); return(response); } _roleWriteRepository.Delete(role); await _uow.CommitAsync(); return(new Response(role)); }
public async Task <IActionResult> GetAll() { var data = await _roleReadRepository.GetAsync(); return(Ok(data)); }