public static List<Column> GetColumnsByReport(int reportId) { using (DbEntities db = new DbEntities()) { var results = db.Columns.Where(c => c.ReportId.Equals(reportId)).ToList(); results.ForEach(c => db.Detach(c)); return results; } }
public static List<Transfer> GetTransferMapping(int reportFromId, int reportToId) { using (DbEntities db = new DbEntities()) { var results = db.Transfers.Where(t => t.ReportFromId.Equals(reportFromId) && t.ReportToId.Equals(reportToId)).ToList(); results.ForEach(t => db.Detach(t)); return results; } }
public static List<Report> GetAllReports() { using (DbEntities db = new DbEntities()) { var results = db.Reports.ToList(); results.ForEach(r => db.Detach(r)); return results; } }