public async Task <IActionResult> CreateOIF([FromBody] OIF oif) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await oifService.InsertAsync(oif); await oifService.SaveChangesAsync(); return(Ok()); }
public async void Delete(OIF oif) { var branch = await branchRepo.FindAsync(oif.BranchId); oif.HistoryGroupId = Guid.NewGuid(); // Branch.NewAffiliationId is the same with Request.Id await historyRepo.InsertAsync(new History { date = DateTime.Now, action = "OIF for Branch: " + oif.dbaName + " Deleted", groupCode = role, user = user, RequestId = branch.NewAffiliationId, AuditLogGroupId = branch.AuditLogGroupId, HistoryGroupId = oif.HistoryGroupId }); oifRepo.Delete(oif); }