public void UpdateTypeProduct(TypeProduct typePro) { using (var context = new WebServiceDBContext()) { context.Entry(typePro).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void AddTypeProduct(TypeProduct typePro) { using (var context = new WebServiceDBContext()) { context.TypeProduct.Add(typePro); context.SaveChanges(); } }
public void RemoveTypeProduct(long id) { using (var context = new WebServiceDBContext()) { TypeProduct tproduct = context.TypeProduct.Find(id); context.Entry(tproduct).State = EntityState.Deleted; context.SaveChanges(); } }
public TypeProduct GetTypeProduct(long id) { TypeProduct tproduct = null; using (var context = new WebServiceDBContext()) { tproduct = context.TypeProduct.Find(id); } return(tproduct); }