internal Comment(CommentCreate creationData, User user) { PostId = creationData.PostId; Body = creationData.Body; ParentId = creationData.ParentId; CreationDate = DateTime.UtcNow; UserId = user.Id; Votes = new VoteStats(); }
public Comment Create( int id, int userId, int postId, int parentId, string body, VoteStats votes, DateTime creationDate, bool wasUpdated, bool wasDeleted ) => new Comment(id, userId, postId, parentId, body, votes, creationDate, wasUpdated, wasDeleted);
internal Comment(int id, int userId, int postId, int parentId, string body, VoteStats votes, DateTime creationDate, bool wasUpdated, bool wasDeleted) { Id = id; UserId = userId; PostId = postId; ParentId = parentId; Body = body; Votes = votes; CreationDate = creationDate; WasUpdated = wasUpdated; WasDeleted = wasDeleted; }
internal Post(int id, int userId, int spaceId, PostType type, string title, string body, DateTime creationDate, int commentCount, VoteStats votes, bool wasUpdated = false, bool wasDeleted = false) { Id = id; UserId = userId; SpaceId = spaceId; Type = type; Title = title; Body = body; CreationDate = creationDate; CommentCount = commentCount; Votes = votes; WasUpdated = wasUpdated; WasDeleted = wasDeleted; if (Type == PostType.Link && !Regex.IsMatch(Body, RegexPattern.UrlProtocol)) { Body = $"http://{Body}"; } }