public async Task <IActionResult> UpdateProfile([FromBody] List <ApplicationUser> model) { bool result = false; foreach (var user in model) { result = await _userSvc.UpdateProfileAsync(user); } if (result) { return(Ok(new { Message = "Test Profiles updated Successfully!" })); } return(BadRequest(new { Message = "Could not Update Profiles." })); }
public async Task <IActionResult> UpdateProfile(IFormCollection formData) { ProfileModel model = new ProfileModel { Username = formData["Username"] }; var password = formData["Password"].ToString(); if (await _userSvc.CheckPasswordAsync(model, password)) { var result = await _userSvc.UpdateProfileAsync(formData); if (result) { return(Ok(new { Message = "Profile updated Successfully!" })); } } return(BadRequest(new { Message = "Could not Update Profile" })); }