aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Entities/TimelineEntity.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline/Entities/TimelineEntity.cs')
-rw-r--r--Timeline/Entities/TimelineEntity.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/Timeline/Entities/TimelineEntity.cs b/Timeline/Entities/TimelineEntity.cs
new file mode 100644
index 00000000..f4c7045d
--- /dev/null
+++ b/Timeline/Entities/TimelineEntity.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Timeline.Entities
+{
+ public enum TimelineVisibility
+ {
+ Public,
+ Private
+ }
+
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2227:Collection properties should be read only", Justification = "This is entity object.")]
+ [Table("timelines")]
+ public class TimelineEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ /// <summary>
+ /// If null, then this timeline is a personal timeline.
+ /// </summary>
+ [Column("name")]
+ public string? Name { get; set; }
+
+ [Column("description")]
+ public string? Description { get; set; }
+
+ [Column("owner")]
+ public long OwnerId { get; set; }
+
+ [ForeignKey(nameof(OwnerId))]
+ public User Owner { get; set; } = default!;
+
+ [Column("visibility")]
+ public TimelineVisibility Visibility { get; set; }
+
+ [Column("create_time")]
+ public DateTime CreateTime { get; set; }
+
+ public List<TimelineMemberEntity> Members { get; set; } = default!;
+
+ public List<TimelinePostEntity> Posts { get; set; } = default!;
+ }
+}