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

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

            return(entity);
        }
Example #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);
        }
Example #4
0
 public void Remove(SightingDailyLog entity)
 {
     this.DailyLogs.Remove(entity);
     this.SaveChanges();
 }