/// <summary> /// Deprecated Method for adding a new object to the CategoryLang EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCategoryLang(CategoryLang categoryLang) { base.AddObject("CategoryLang", categoryLang); }
private void CreateOrChangeContentLang(SiteContainer context, Category instance, Category cache, Language lang) { CategoryLang contenttLang = null; if (cache != null) { contenttLang = context.CategoryLang.FirstOrDefault(p => p.CategoryId == cache.Id && p.LanguageId == lang.Id); } if (contenttLang == null) { var newPostLang = new CategoryLang { CategoryId = instance.Id, LanguageId = lang.Id, Title = instance.Title, }; context.AddToCategoryLang(newPostLang); } else { contenttLang.Title = instance.Title; } context.SaveChanges(); }
/// <summary> /// Create a new CategoryLang object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="categoryId">Initial value of the CategoryId property.</param> /// <param name="languageId">Initial value of the LanguageId property.</param> public static CategoryLang CreateCategoryLang(global::System.Int32 id, global::System.String title, global::System.Int32 categoryId, global::System.Int32 languageId) { CategoryLang categoryLang = new CategoryLang(); categoryLang.Id = id; categoryLang.Title = title; categoryLang.CategoryId = categoryId; categoryLang.LanguageId = languageId; return categoryLang; }