public List <Waterbody> GetWaterbodies() { List <Waterbody> waterbodies; waterbodies = Waterbodies.OrderBy(a => a.State) .ThenBy(a => a.County) .ThenBy(a => a.LakeName) .ToList(); return(waterbodies); }
public int GetWaterbodyID(double latitude, double longitude) { var foundWaterbody = Waterbodies.Where(w => w.Latitude == latitude && w.Longitude == longitude) .FirstOrDefault(); if (foundWaterbody == null) { return(0); } return(foundWaterbody.WaterbodyID); }
public int GetWaterbodyID(string lakeName, string county, string state) { var foundWaterbody = Waterbodies.Where(w => w.LakeName == lakeName && w.County == county && w.State == state) .FirstOrDefault(); if (foundWaterbody == null) { return(0); } return(foundWaterbody.WaterbodyID); }
public List <Waterbody> GetWaterbodiesWithFishtypes() { List <Waterbody> waterbodies; waterbodies = Waterbodies.Include(waterbody => waterbody.FishWaters) .ThenInclude(fishwater => fishwater.Fishtype) .OrderBy(a => a.State) .ThenBy(a => a.County) .ThenBy(a => a.LakeName) .ToList(); Console.Write(waterbodies.ToString()); return(waterbodies); }
public bool AnyWaterbodiesExist() { return(Waterbodies.Any()); }
public void AddWaterbody(Waterbody waterbody) { Waterbodies.Add(waterbody); SaveChanges(); }