/// <summary> /// Create a new caterer object. /// </summary> /// <param name="id">Initial value of the Id property.</param> public static caterer Createcaterer(global::System.Int32 id) { caterer caterer = new caterer(); caterer.Id = id; return(caterer); }
public List <caterer> find(caterer u) { Database1Entities4 d = new Database1Entities4(); List <caterer> list = d.caterers.Where(x => (x.name == u.name) || (x.city == u.city)).ToList(); return(list); }
public void remove(int id) { using (Database1Entities4 f = new Database1Entities4()) { caterer obj = f.caterers.First(x => x.Id == id); f.caterers.DeleteObject(obj); f.SaveChanges(); } }
public void add(caterer u, int i) { user usr = null; using (Database1Entities4 f = new Database1Entities4()) { usr = f.users.First(x => x.Id == i); u.user = usr; usr.caterers.Add(u); f.caterers.AddObject(u); f.SaveChanges(); } }
/// <summary> /// Deprecated Method for adding a new object to the caterers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTocaterers(caterer caterer) { base.AddObject("caterers", caterer); }