public Comment(SetterComment SetterComment) { PostId = SetterComment.PostId; CommentId = SetterComment.CommentId; CreatedByUID = SetterComment.CreatedByUID; Content = SetterComment.Content; CreatedAt = DateTime.UtcNow; DeletedAt = null; }
//public static WriteConcernResult Create(MongoDBConnection db, SetterComment SetterComment) //{ // // TODO //} public static Comment IsUniqueComment(MongoDBConnection db, SetterComment SetterComment) { if (db.Comments.Count() > 0) { return db.Comments.FindOne(Query<Comment>.Where(i => i.PostId == SetterComment.PostId && (i.PostId == SetterComment.PostId && i.CreatedByUID == SetterComment.CreatedByUID))); } return null; }