Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class BaseEntity
- {
- public int Id { get; set; }
- }
- public class Forum : BaseEntity
- {
- public string Name { get; set; } // movie, cartoon, book, comics, anime, manga, other
- public string Description { get; set; }
- public virtual IEnumerable<Post> Posts { get; set; }
- }
- public class Post : BaseEntity
- {
- public int ForumId { get; set; }
- public int AuthorId { get; set; }
- public virtual ApplicationUser Author { get; set; }
- public string Title { get; set; }
- public string Text { get; set; }
- public virtual IEnumerable<Attachment> Attachments { get; set; }
- public virtual IEnumerable<Comment> Comments { get; set; }
- public int Rating { get; set; } // haven't "-1"; can't be negative
- public bool IsSolved { get; set; }
- public DateTime Created { get; set; }
- public DateTime Updated { get; set; } // at first equal to 'Created'
- public bool Show { get; set; } // for moderate
- }
- public class ApplicationUser : IdentityUser<int>
- {
- public string Avatar { get; set; }
- public string Cover { get; set; } // Background Image in user profile page
- public int Karma { get; set; }
- }
- public class Attachment : BaseEntity
- {
- public AttachmentType Type { get; set; }
- public string Link { get; set; }
- }
- public enum AttachmentType
- {
- Image,
- Video,
- Link
- }
- public class Comment : BaseEntity
- {
- public int PostId { get; set; } // owned post id
- public int? ParentId { get; set; } // to whom the answer
- public int AuthorId { get; set; }
- public virtual ApplicationUser Author { get; set; }
- public string Text { get; set; }
- public virtual IEnumerable<Attachment> Attachments { get; set; }
- public int Rating { get; set; } //? "-1" divide by 2 when go to karma
- public bool IsCorectAnswer { get; set; }
- public DateTime Created { get; set; }
- public DateTime Updated { get; set; } // at first equal to 'Created'
- public bool Show { get; set; } // for moderate
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement