public IHttpActionResult CreateRole(NewRole newRole) { if (newRole == null) { throw new ArgumentNullException("newRole"); } if (string.IsNullOrWhiteSpace(newRole.Name)) { throw new ArgumentException("Role name must be defined."); } Role role = mapperFactory.CreateRoleMapper().Map(identityManagementService.CreateRole(newRole.Name, newRole.Description, newRole.ExternalGroupName)); return(Ok(role)); }