public bool Update(ProductCategoryTranslation productCategoryTranslation)
        {
            _productDatabaseContext.Update(productCategoryTranslation);
            int result = _productDatabaseContext.SaveChanges();

            return(Convert.ToBoolean(result));
        }
        public bool Delete(Guid id)
        {
            ProductCategoryTranslation productCategoryTranslation = this.GetById(id);

            _productDatabaseContext.Remove(productCategoryTranslation);
            int result = _productDatabaseContext.SaveChanges();

            return(Convert.ToBoolean(result));
        }
        private void AddEntityIfNotExists(ProductCategoryTranslation entity)
        {
            if (_context.ProductCategoryTranslations.Any(p => p.Name == entity.Name && p.Language == entity.Language))
            {
                return;
            }

            _context.ProductCategoryTranslations.Add(entity);
            _context.SaveChanges();
        }
 public Guid Save(ProductCategoryTranslation productCategoryTranslation)
 {
     _productDatabaseContext.Add(productCategoryTranslation);
     _productDatabaseContext.SaveChanges();
     return(productCategoryTranslation.Id);
 }
        public ProductCategoryTranslation GetById(Guid id)
        {
            ProductCategoryTranslation model = _productDatabaseContext.Set <ProductCategoryTranslation>().Where(p => p.Id == id).FirstOrDefault();

            return(model);
        }
コード例 #6
0
 public async Task <int> Update(ProductCategoryTranslation productCategoryTranslation)
 {
     return(await Context.SaveChangesAsync());
 }
コード例 #7
0
 public async Task <int> Insert(ProductCategoryTranslation productCategoryTranslation)
 {
     _productCategoryTranslation.Create(productCategoryTranslation);
     return(await Context.SaveChangesAsync());
 }
 public bool Update(ProductCategoryTranslation productCategoryTranslation)
 {
     return(_productCategoryTranslationRepository.Update(productCategoryTranslation));
 }
 public Guid Save(ProductCategoryTranslation productCategoryTranslation)
 {
     _productCategoryTranslationRepository.Save(productCategoryTranslation);
     return(productCategoryTranslation.Id);
 }