Пример #1
0
 public IEnumerable<ReadingLog> GetReadings(PagingInfo parameters)
 {
     Entities context = new Entities();
     return context.Readings
         .Skip(() => parameters.Page*parameters.PageSize)
         .Take(() => parameters.PageSize)
         .Select(r => new ReadingLog {Tag = r.Tag, Reader = r.Reader, ReadingDateTime = r.ReadingDateTIme})
         .ToList();
 }
Пример #2
0
 public void SaveReading(ReadingInfo readingInfo)
 {
     Entities entities = new Entities();
     entities.Readings.Add(new Readings
     {
         Tag = readingInfo.Tag,
         Reader = readingInfo.Reader,
         ReadingDateTIme = readingInfo.ReadingDateTime
     });
     entities.SaveChanges();
 }