Esempio n. 1
0
        public List <Waterbody> GetWaterbodies()
        {
            List <Waterbody> waterbodies;

            waterbodies = Waterbodies.OrderBy(a => a.State)
                          .ThenBy(a => a.County)
                          .ThenBy(a => a.LakeName)
                          .ToList();

            return(waterbodies);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 public bool AnyWaterbodiesExist()
 {
     return(Waterbodies.Any());
 }
Esempio n. 6
0
 public void AddWaterbody(Waterbody waterbody)
 {
     Waterbodies.Add(waterbody);
     SaveChanges();
 }