예제 #1
0
        private void CreateOrChangeContentLang(SiteContainer context, Brand instance, Brand cache, Language lang)
        {

            BrandLang contenttLang = null;
            if (cache != null)
            {
                contenttLang = context.BrandLang.FirstOrDefault(p => p.BrandId == cache.Id && p.LanguageId == lang.Id);
            }
            if (contenttLang == null)
            {
                var newPostLang = new BrandLang
                {
                    BrandId = instance.Id,
                    LanguageId = lang.Id,
                    Title = instance.Title,
                    Description = instance.Description
                };
                context.AddToBrandLang(newPostLang);
            }
            else
            {
                contenttLang.Title = instance.Title;
                contenttLang.Description = instance.Description;
            }
            context.SaveChanges();

        }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the BrandLang EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBrandLang(BrandLang brandLang)
 {
     base.AddObject("BrandLang", brandLang);
 }
예제 #3
0
파일: Brand.cs 프로젝트: fathurxzz/aleqx
 private void SetLang(BrandLang postLang)
 {
     Title = postLang.Title;
     Description = postLang.Description;
 }
예제 #4
0
 /// <summary>
 /// Create a new BrandLang object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="languageId">Initial value of the LanguageId property.</param>
 /// <param name="brandId">Initial value of the BrandId property.</param>
 public static BrandLang CreateBrandLang(global::System.Int32 id, global::System.String title, global::System.Int32 languageId, global::System.Int32 brandId)
 {
     BrandLang brandLang = new BrandLang();
     brandLang.Id = id;
     brandLang.Title = title;
     brandLang.LanguageId = languageId;
     brandLang.BrandId = brandId;
     return brandLang;
 }