diff options
author | 杨宇千 <crupest@outlook.com> | 2019-11-03 00:28:21 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-11-03 00:28:21 +0800 |
commit | cb2d9949ecc1d3c4b10295eb715a9293d493c5e2 (patch) | |
tree | be58859c6235b1be43bb0f989910257ce99f815b /Timeline/Entities/TimelinePostEntity.cs | |
parent | 37a2e6340ab20de1f9e847d795c0cbec9846de97 (diff) | |
download | timeline-cb2d9949ecc1d3c4b10295eb715a9293d493c5e2.tar.gz timeline-cb2d9949ecc1d3c4b10295eb715a9293d493c5e2.tar.bz2 timeline-cb2d9949ecc1d3c4b10295eb715a9293d493c5e2.zip |
Design the entity model primarily.
Diffstat (limited to 'Timeline/Entities/TimelinePostEntity.cs')
-rw-r--r-- | Timeline/Entities/TimelinePostEntity.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Timeline/Entities/TimelinePostEntity.cs b/Timeline/Entities/TimelinePostEntity.cs new file mode 100644 index 00000000..efef3ab5 --- /dev/null +++ b/Timeline/Entities/TimelinePostEntity.cs @@ -0,0 +1,34 @@ +using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Timeline.Entities
+{
+ [Table("timeline_posts")]
+ public class TimelinePostEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Column("timeline")]
+ public long TimelineId { get; set; }
+
+ [ForeignKey(nameof(TimelineId))]
+ public TimelineEntity Timeline { get; set; } = default!;
+
+ [Column("author")]
+ public long AuthorId { get; set; }
+
+ [ForeignKey(nameof(AuthorId))]
+ public User Author { get; set; } = default!;
+
+ [Column("content")]
+ public string? Content { get; set; }
+
+ [Column("time")]
+ public DateTime Time { get; set; }
+
+ [Column("last_updated")]
+ public DateTime LastUpdated { get; set; }
+ }
+}
|