Exemplo n.º 1
0
 private static void EditReport(ReportConfig editreport)
 {
     using (TeamDbContext dbContext = new TeamDbContext())
     {
         if (dbContext.ReportConfigs.AsNoTracking().FirstOrDefault(e => e.Id == editreport.Id) != null)
         {
             dbContext.ReportConfigs.UpdateRange(editreport);
             dbContext.SaveChanges();
         }
     }
 }
Exemplo n.º 2
0
 private static void AddReport(ReportConfig addreport)
 {
     using (TeamDbContext dbContext = new TeamDbContext())
     {
         if (dbContext.ReportConfigs.FirstOrDefault(e => e.Id == addreport.Id) == null)
         {
             dbContext.ReportConfigs.Add(addreport);
             dbContext.SaveChanges();
         }
     }
 }