Changeset 12691 for branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/DowntimeDao.cs
- Timestamp:
- 07/08/15 15:51:32 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.Hive.DataAccess/3.3/Daos/DowntimeDao.cs
r12468 r12691 29 29 30 30 public override Downtime GetById(Guid id) { 31 return Table.SingleOrDefault(x => x.DowntimeId ==id);31 return GetByIdQuery(DataContext, id); 32 32 } 33 34 public IQueryable<Downtime> GetByResourceId(Guid id) { 35 return Table.Where(x => x.ResourceId == id); 36 } 37 38 #region Compiled queries 39 private static readonly Func<DataContext, Guid, Downtime> GetByIdQuery = 40 CompiledQuery.Compile((DataContext db, Guid downtimeId) => 41 (from downtime in db.GetTable<Downtime>() 42 where downtime.DowntimeId == downtimeId 43 select downtime).SingleOrDefault()); 44 #endregion 33 45 } 34 46 }
Note: See TracChangeset
for help on using the changeset viewer.