public bool RemoveUser(long userID) { return(m_Locker.Synchronized(userID, () => { var deleted = TBL_USER.Remove(userID); if (!deleted) { return false; } var posts = TBL_USERPOST.Get(userID) as List <long>; if (posts == null) { return true; } TBL_USERPOST.Remove(userID); //todo Rewrite with table.RemoveReturning() foreach (var postID in posts) { TBL_POST.Remove(postID); } return true; })); }
public bool RemovePost(long postID) { var post = TBL_POST.Get(postID) as Post; if (post == null) { return(false); } return(m_Locker.Synchronized(post.UserID, () => { var result = TBL_POST.Remove(postID); TBL_USERPOST.Remove(post.UserID); return result; })); }