public async Task UpdateTenderReport(Guid templateReportId, Entities.TenderReport tenderReport) { var tenderReportFromDB = await _context.TenderReport.FirstOrDefaultAsync(c => c.TenderReportId == templateReportId); tenderReport.TenderReportId = tenderReportFromDB.TenderReportId; _context.Entry(tenderReportFromDB).CurrentValues.SetValues(tenderReport); _context.Entry(tenderReportFromDB).Property(x => x.CreatedDate).IsModified = false; _context.Entry(tenderReportFromDB).Property(x => x.CreatedBy).IsModified = false; await _context.SaveChangesAsync(); }
public async Task CreateTenderReport(Entities.TenderReport tenderReport) { _context.TenderReport.Add(tenderReport); await _context.SaveChangesAsync(); }