// Create public int Create(PRODUCT_KIND productKindModel) { productKindModel.Is_Deleted = false; db.PRODUCT_KIND.Add(productKindModel); db.SaveChanges(); return(productKindModel.Id_ProductKind); }
// Update public bool Update(PRODUCT_KIND pkModel) { var targetUpdate = db.PRODUCT_KIND.Find(pkModel.Id_ProductKind); try { targetUpdate.Name_ProductKind = pkModel.Name_ProductKind; db.SaveChanges(); return(true); } catch (Exception e) { return(false); throw new Exception(e.Message); } }