/// <summary> /// This method permit update a register products from database /// </summary> /// <param name="modelProduct"></param> /// <returns></returns> public IObservable <ProductsModel> UpdateProduct(ProductsModel modelProduct) { using (ApplicactionDbContext Db = new ApplicactionDbContext()) { Db.Entry(modelProduct).State = EntityState.Modified; Db.SaveChanges(); return(Observable.Return(modelProduct)); } }
/// <summary> /// This method save the product into the database /// </summary> /// <param name="reserve"></param> /// <returns></returns> public IObservable <ProductsModel> SetProduct(ProductsModel reserve) { using (ApplicactionDbContext Db = new ApplicactionDbContext()) { Db.Add(reserve); Db.SaveChanges(); return(Observable.Return(reserve)); } }