Пример #1
0
 public void UpdateCategory(ProductCategory category)
 {
     var oldCategory = GetProductCategory(category.Id);
     oldCategory.Name = category.Name;
     oldCategory.Description = category.Description;
     categoryRepo.SaveChanges();
 }
Пример #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ProductCategories EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProductCategories(ProductCategory productCategory)
 {
     base.AddObject("ProductCategories", productCategory);
 }
Пример #3
0
 public static ProductCategoryModel FromDomainModel(ProductCategory category)
 {
     return new ProductCategoryModel {
         Id = category.Id,
         Name = category.Name,
         Description = category.Description
     };
 }
Пример #4
0
 /// <summary>
 /// Create a new ProductCategory object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 /// <param name="objectInfo">Initial value of the ObjectInfo property.</param>
 public static ProductCategory CreateProductCategory(global::System.Int32 id, global::System.String name, ObjectInfo objectInfo)
 {
     ProductCategory productCategory = new ProductCategory();
     productCategory.Id = id;
     productCategory.Name = name;
     productCategory.ObjectInfo = StructuralObject.VerifyComplexObjectIsNotNull(objectInfo, "ObjectInfo");
     return productCategory;
 }