示例#1
0
        public SightingDailyLog Add(SightingDailyLog entity)
        {
            var item = this.DailyLogs.Add(entity);

            this.SaveChanges();
            return(item);
        }
示例#2
0
        public async Task <SightingDailyLog> Update(SightingDailyLog entity)
        {
            this.DailyLogs.AddOrUpdate(entity);
            await this.SaveChangesAsync();

            return(entity);
        }
示例#3
0
        public ZooAnimalSighting GetDailyLogEntry(string userName, DateTime day, int id)
        {
            SightingDailyLog dailyLog = this.DailyLogs
                                        .Include(l => l.Sightings)
                                        .Single(l => l.SightingDate == day);

            ZooAnimalSighting sighting = dailyLog.Sightings.Single(s => s.Id == id);

            return(sighting);
        }
示例#4
0
 public void Remove(SightingDailyLog entity)
 {
     this.DailyLogs.Remove(entity);
     this.SaveChanges();
 }