public Location addLocation(string locationName, string xCoord, string yCoord) { PointDAL pointDAL = new PointDAL(); Point point = pointDAL.addPoint(xCoord, yCoord); Location location = new Location(locationName, point); db.locations.Add(location); return location; }
public Restaurant addRestaurant(String name, String cuisine, int fanciness, String websiteUrl, String houseNumber, String street1, String street2, String zipCode, String city, String xCoord, String yCoord) { AddressDAL addressDAL = new AddressDAL(); Address restaurantAddress = addressDAL.addAddress(houseNumber, street1, street2, zipCode, city); PointDAL pointDAL = new PointDAL(); Point point = pointDAL.addPoint(xCoord, yCoord); Restaurant restaurant = new Restaurant(name, cuisine, fanciness, websiteUrl, restaurantAddress, point); db.restaurants.Add(restaurant); db.Entry(restaurant).State = System.Data.EntityState.Added; db.SaveChanges(); return restaurant; }