public IHttpActionResult AddUserRole(Guid userId, AddUserRoleCommand command) { if (userId == Guid.Empty) { throw new ArgumentException("userId must be defined."); } if (command == null) { throw new ArgumentNullException("command"); } if (command.RoleId == Guid.Empty) { throw new ArgumentException("User role id must be defined."); } identityManagementService.AddUserRole(userId, command.RoleId); return(Ok()); }