public static void SaveTaStats(this IMrsCellTaRepository repository, IEnumerable <MrsCellTa> stats) { foreach (MrsCellTa stat in from stat in stats let item = repository.GetAll().FirstOrDefault(x => x.RecordDate == stat.RecordDate && x.CellId == stat.CellId && x.SectorId == stat.SectorId) where item == null select stat) { stat.UpdateStats(); repository.Insert(stat); } }
public MrsCellTa Get(int cellId, byte sectorId, DateTime date) { return(_repository.GetAll().FirstOrDefault(x => x.CellId == cellId && x.SectorId == sectorId && x.RecordDate == date)); }