示例#1
0
        public bool UpdateAddress(int id, RestaurantAddress address)
        {
            Restaurant rest = dbContext.Restaurants.Find(id);

            RestaurantAddress restAdd = dbContext.RestaurantAddresses.Where(addr => addr.RestaurantId == id).SingleOrDefault();

            restAdd.Latitude         = address.Latitude;
            restAdd.Longitude        = address.Longitude;
            restAdd.FormattedAddress = address.FormattedAddress;

            RestaurantAddressRepositroy restAddRepo = new RestaurantAddressRepositroy();

            return(restAddRepo.Update(restAdd, restAdd.Id));
        }
示例#2
0
 public RestaurantAddressService()
 {
     this.restAddRepo = new RestaurantAddressRepositroy();
 }