public async Task <IHttpActionResult> AddToRole(string userId, string roleId) { if (userId == null || roleId == null) { return(BadRequest()); } var result = await _roleManager.AddToRole(userId, roleId); return(result.Succeeded ? (IHttpActionResult)NotFound() : Ok()); }
public async Task <IHttpActionResult> AddToRole(string userId, string roleId) { if (string.IsNullOrWhiteSpace(userId) || string.IsNullOrWhiteSpace(roleId)) { return(BadRequest("Incorrect input data value")); } var result = await _roleManager.AddToRole(userId, roleId); return(result.Succeeded ? (IHttpActionResult)NotFound() : Ok()); }
public async Task <IHttpActionResult> AddToRole(string userId, string roleId) { var result = await _roleManager.AddToRole(userId, roleId); return(result.Succeeded ? (IHttpActionResult)NotFound() : Ok()); }