public int AddLocation(Plocation location) { int i = 0; try { DBinstance.Instance.Add(location); i = DBinstance.Instance.SaveChanges(); } catch (DbUpdateConcurrencyException ex) { Console.WriteLine("Insertion Gone Wrong, Pls Check your network:"); Console.WriteLine(); } catch (Exception e) { Console.WriteLine("Couldn't Insert LOCATION: "); Console.WriteLine(e); Console.WriteLine(); } return(i); }
public List <Pizza> GetPizzasFromLocation(Plocation location) { //if it is distinct by name, you can get an exception. This logic is not feasible return(GetDistinctPizzas().Where <Pizza>(r => r.SLocationId == location.LocationId).ToList()); }
public void voidDeleteLocation(Plocation location) { }