public void SetLastPost(Forum_Thread Thread, Forum_User User, int PostNumber, bool IncreaseOnly = true) { var Last = db.Forum_ViewedPosts.SingleOrDefault(P => P.Forum_User == User && P.Forum_Thread == Thread); if (Last == null) { Last = new Forum_ViewedPost(); Last.Forum_Thread = Thread; Last.Forum_User = User; db.Forum_ViewedPosts.InsertOnSubmit(Last); } else if (Last.LastPost >= PostNumber && IncreaseOnly) return; Last.LastPost = PostNumber; }
private void detach_Forum_ViewedPosts(Forum_ViewedPost entity) { this.SendPropertyChanging(); entity.Forum_User = null; }
partial void DeleteForum_ViewedPost(Forum_ViewedPost instance);
partial void UpdateForum_ViewedPost(Forum_ViewedPost instance);
partial void InsertForum_ViewedPost(Forum_ViewedPost instance);
private void attach_Forum_ViewedPosts(Forum_ViewedPost entity) { this.SendPropertyChanging(); entity.Forum_Thread = this; }