public int Update(ProductSubCategory item)
 {
     item.CategoryName         = context.ProductCategory.Where(x => x.ProductCategoryID == item.ProductCategoryID).Select(y => y.Name).FirstOrDefault();
     item.ModifiedDate         = DateTime.Now;
     context.Entry(item).State = EntityState.Modified;
     return(context.SaveChanges());
 }
        public virtual TD Create(TD dto)
        {
            Validate(dto);
            var entity = ToEntity(dto);

            PdmContext.Set(typeof(TE)).Add(entity);
            PdmContext.SaveChanges();

            return(Mapper.Map <TE, TD>(entity));
        }
Ejemplo n.º 3
0
 public int Update(ProductModel item)
 {
     item.ModifiedDate         = DateTime.Now;
     context.Entry(item).State = EntityState.Modified;
     return(context.SaveChanges());
 }
Ejemplo n.º 4
0
 int IRepositoryBase <Product> .Update(Product item)
 {
     context.Entry(item).State = EntityState.Modified;
     return(context.SaveChanges());
 }