//all the changes will be cached locally without refreshing/redropping the context public static void pushDismissal(ArgPoint ap, DiscCtx ctx) { var persId = SessionInfo.Get().person.Id; var apId = ap.Id; ap = ctx.ArgPoint.Single(ap0 => ap0.Id == apId); foreach (var c in ap.Comment) { //skip "new comment" if (c.Person == null) { continue; } var existing = c.ReadEntry.FirstOrDefault(re => re.Person.Id == persId); if (existing == null) { var entry = new CommentPersonReadEntry { Comment = c, Person = ctx.Person.Single(p => p.Id == persId) }; ctx.AddToCommentPersonReadEntry(entry); } } try { ctx.SaveChanges(); } catch { } UISharedRTClient.Instance.clienRt.SendCommentsRead(SessionInfo.Get().person.Id, ap.Topic.Id, ap.Id, -1); }