Ejemplo n.º 1
0
 public void Add(River con)
 {
     try
     {
         var            tempList    = con.Countries.Select(s => s.ID).ToList();
         List <Country> countryList = uow.countryRepo.getAll().FindAll(s => tempList.Contains(s.ID));
         con.SetCountries(countryList);
         uow.riverRepo.add(con);
         uow.Complete();
     }catch (Exception e)
     {
         throw new Exception("RiverManager Add " + e);
     }
 }
Ejemplo n.º 2
0
        public void Update(River river, String name, Double lenght, List <Country> countries)
        {
            try
            {
                var            tempList    = countries.Select(s => s.ID).ToList();
                List <Country> countryList = uow.countryRepo.getAll().FindAll(s => tempList.Contains(s.ID));

                river.SetLenght(lenght);
                river.SetName(name);
                river.SetCountries(countryList);
                uow.Complete();
            }
            catch (Exception e)
            {
                throw new Exception("RiverManager Update " + e.Message);
            }
        }