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)); }
public int Update(ProductModel item) { item.ModifiedDate = DateTime.Now; context.Entry(item).State = EntityState.Modified; return(context.SaveChanges()); }
int IRepositoryBase <Product> .Update(Product item) { context.Entry(item).State = EntityState.Modified; return(context.SaveChanges()); }