public void Execute(RolePutDto request) { _validator.ValidateAndThrow(request); var role = _context.Roles.Find(request.Id); if (role == null) { throw new EntityNotFoundException(request.Id, typeof(Role)); } role.Name = request.Name; _context.SaveChanges(); }
public void Put([FromBody] RolePutDto dto, [FromServices] IUpdateRoleCommand command) { executor.ExecuteCommand(command, dto); }