Ejemplo n.º 1
0
        public int AddCategory(Category category)
        {
            _db.Category.AddObject(category);
            _db.SaveChanges();

            return category.Id;
        }
Ejemplo n.º 2
0
 public void EditCategory(Category category)
 {
     _db.ObjectStateManager.ChangeObjectState(category, EntityState.Modified);
     _db.SaveChanges();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a new Category object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="creationDate">Initial value of the CreationDate property.</param>
 /// <param name="modificationDate">Initial value of the ModificationDate property.</param>
 public static Category CreateCategory(global::System.Int32 id, global::System.String title, global::System.DateTime creationDate, global::System.DateTime modificationDate)
 {
     Category category = new Category();
     category.Id = id;
     category.Title = title;
     category.CreationDate = creationDate;
     category.ModificationDate = modificationDate;
     return category;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Category EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCategory(Category category)
 {
     base.AddObject("Category", category);
 }