Beispiel #1
0
        public CatalogDiscount UpdateCatalogDiscount(CatalogDiscount updatedEntity)
        {
            var existingObj = this.context.CatalogDiscounts.Where(p => p.Id == updatedEntity.Id).FirstOrDefault();

            this.context.Entry(existingObj).CurrentValues.SetValues(updatedEntity);
            this.context.SaveChanges();
            return(updatedEntity);
        }
 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     CatalogMetadata.OnModelCreating(modelBuilder);
     CatalogGroup.OnModelCreating(modelBuilder);
     CatalogCategory.OnModelCreating(modelBuilder);
     CatalogDiscount.OnModelCreating(modelBuilder);
     base.OnModelCreating(modelBuilder);
 }
Beispiel #3
0
 public CatalogDiscount CreateCatalogDiscount(CatalogDiscount entity)
 {
     this.context.CatalogDiscounts.Add(entity);
     this.context.SaveChanges();
     return(entity);
 }