Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public void Put([FromBody] RolePutDto dto, [FromServices] IUpdateRoleCommand command)
 {
     executor.ExecuteCommand(command, dto);
 }