public async Task <IActionResult> CreateKeyResultArea(string empId, IEnumerable <KeyResultAreaDtoForCreation> model) { try { foreach (var item in model) { item.myId = empId; } var hasUploaded = resultArea.HasUploadedEpa(int.Parse(empId)); if (!hasUploaded) { var entityToAdd = mapper.Map <IEnumerable <KeyResultAreaDtoForCreation>, IEnumerable <KeyResultArea> >(model); var result = await resultArea.AddKeyOutcomes(entityToAdd); var entityToReturn = mapper.Map <IEnumerable <KeyResultArea> >(entityToAdd); resultArea.SendApprovalNotification(entityToReturn); } return(CreatedAtRoute("Mykpi", new { empId = empId }, model)); } catch (Exception ex) { throw ex; } }