private void attach_PostLangs(PostLang entity)
		{
			this.SendPropertyChanging();
			entity.Post = this;
		}
		private void detach_PostLangs(PostLang entity)
		{
			this.SendPropertyChanging();
			entity.Post = null;
		}
 partial void DeletePostLang(PostLang instance);
 partial void UpdatePostLang(PostLang instance);
 partial void InsertPostLang(PostLang instance);
示例#6
0
 private void CreateOrChangePostLang(Post instance, Post cache, Language lang)
 {
     PostLang postLang = null;
     if (cache != null)
     {
         postLang = Db.PostLangs.FirstOrDefault(p => p.PostID == cache.ID && p.LanguageID == lang.ID);
     }
     if (postLang == null)
     {
         var newPostLang = new PostLang()
         {
             PostID = instance.ID,
             LanguageID = lang.ID,
             Header = instance.Header,
             Content = instance.Content,
         };
         Db.PostLangs.InsertOnSubmit(newPostLang);
     }
     else
     {
         postLang.Header = instance.Header;
         postLang.Content = instance.Content;
     }
     Db.PostLangs.Context.SubmitChanges();
 }
示例#7
0
 private void SetLang(PostLang postLang)
 {
     Header = postLang.Header;
     Content = postLang.Content;
 }