public static void GetById() { Console.WriteLine("Id:"); var id = Convert.ToInt32(Console.ReadLine()); var _mapper = SetupMapper(); DalEF.Concrete.AdressDalEf Dal = new DalEF.Concrete.AdressDalEf(_mapper); var addr = Dal.GetAdressByID(id); Console.WriteLine("AdressID \t" + "CountryID \t" + "City \t" + "Street \t"); Console.WriteLine("{0} \t{1} \t{2} \t{3} \t", addr.AdressID, addr.CountryID, addr.City, addr.Street); }
public static void Update() { Console.WriteLine("Id:"); var id = Convert.ToInt32(Console.ReadLine()); var _mapper = SetupMapper(); DalEF.Concrete.AdressDalEf Dal = new DalEF.Concrete.AdressDalEf(_mapper); var addr = Dal.GetAdressByID(id); Console.WriteLine("County id:"); var c_id = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("City:"); var city = Console.ReadLine(); Console.WriteLine("Street:"); var street = Console.ReadLine(); addr.City = city; addr.Street = street; addr.CountryID = c_id; Dal.UpdateAdress(addr); }