public SightingDailyLog Add(SightingDailyLog entity) { var item = this.DailyLogs.Add(entity); this.SaveChanges(); return(item); }
public async Task <SightingDailyLog> Update(SightingDailyLog entity) { this.DailyLogs.AddOrUpdate(entity); await this.SaveChangesAsync(); return(entity); }
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); }
public void Remove(SightingDailyLog entity) { this.DailyLogs.Remove(entity); this.SaveChanges(); }