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" })); }