public async Task <IActionResult> CreateMAEF([FromBody] MAEF maef) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await maefService.InsertAsync(maef); await maefService.SaveChangesAsync(); return(Ok(maef)); }
public async Task Update(MAEF maef) { var maefData = await requestRepo.GetFirstOrDefaultAsync(predicate : c => c.Id == maef.RequestId); maef.AuditLogGroupId = maefData.AuditLogGroupId; maef.HistoryGroupId = Guid.NewGuid(); await historyRepo.InsertAsync(new History { date = DateTime.Now, action = "MAEF Details Updated", groupCode = role, user = user, RequestId = maefData.Id, AuditLogGroupId = maefData.AuditLogGroupId, HistoryGroupId = maef.HistoryGroupId }); maefRepo.Update(maef); }
public async Task InsertAsync(MAEF maef) { await maefRepo.InsertAsync(maef); }