/// <summary> /// Create a new TechnologyItem object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="sortOrder">Initial value of the SortOrder property.</param> /// <param name="technologyId">Initial value of the TechnologyId property.</param> public static TechnologyItem CreateTechnologyItem(global::System.Int32 id, global::System.Int32 sortOrder, global::System.Int32 technologyId) { TechnologyItem technologyItem = new TechnologyItem(); technologyItem.Id = id; technologyItem.SortOrder = sortOrder; technologyItem.TechnologyId = technologyId; return technologyItem; }
/// <summary> /// Deprecated Method for adding a new object to the TechnologyItem EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTechnologyItem(TechnologyItem technologyItem) { base.AddObject("TechnologyItem", technologyItem); }
public ActionResult AddContentItem(int contentId, TechnologyItem model) { var content = _context.Technology.Include("Parent").First(c => c.Id == contentId); string catId = ""; string subCatId = ""; if (content.Parent != null) { catId = content.Parent.Name; subCatId = content.Name; } else { catId = content.Name; } var ci = new TechnologyItem { SortOrder = model.SortOrder, Text = HttpUtility.HtmlDecode(model.Text) }; content.TechnologyItems.Add(ci); _context.SaveChanges(); return RedirectToAction("Technologies", "Home", new { area = "", categoryId = catId, subCategoryId = subCatId }); }