public async Task <string> AddEditPersonalInfo(PersonalInfo personalInfo) { if (ModelState.IsValid) { if (personalInfo.ID > 0) { personalInfo.LastModifiedDate = DateTime.Now; personalInfo.LastUpdateUser = "******"; _repository.Update <PersonalInfo>(personalInfo, personalInfo.ID); return("Personal Info Updated Successfully"); } else { personalInfo.CreatedDate = DateTime.Now; personalInfo.CreationUser = "******"; await _repository.AddAsyn <PersonalInfo>(personalInfo); var result = await _repository.SaveAsync(); var successMessage = "Personal Info Created Successfully. Name: " + personalInfo.FirstName; TempData["successAlert"] = successMessage; return("Personal Info Created Successfully"); } } return("Failed"); }