public async Task <IActionResult> CreateApproveWithExceptDetails([FromBody] ApproveWithExceptDetails approveWithExceptDetails) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await approveWithExceptDetailsService.InsertAsync(approveWithExceptDetails); await approveWithExceptDetailsService.SaveChangesAsync(); return(Ok(approveWithExceptDetails)); }
public async Task Delete(ApproveWithExceptDetails approveWithExceptDetails) { var awedData = await maefRepo.GetFirstOrDefaultAsync(predicate : c => c.Id == approveWithExceptDetails.MAEFId); approveWithExceptDetails.AuditLogGroupId = awedData.AuditLogGroupId; approveWithExceptDetails.HistoryGroupId = Guid.NewGuid(); await historyRepo.InsertAsync(new History { date = DateTime.Now, action = "Approved With Exception Details Deleted", groupCode = role, user = user, RequestId = awedData.Id, AuditLogGroupId = awedData.AuditLogGroupId, HistoryGroupId = approveWithExceptDetails.HistoryGroupId }); approveWithExceptDetailsRepo.Delete(approveWithExceptDetails); }