diff options
author | crupest <crupest@outlook.com> | 2020-03-05 23:02:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-05 23:02:22 +0800 |
commit | 7ebcea665bcca774428408fc32730505f4a06142 (patch) | |
tree | 8e9577f6f1b2e5245c90f53371dbe8e0eb7d2441 /Timeline/Entities | |
parent | cdf45d5df99d20f327188984544e9b814246fd4a (diff) | |
download | timeline-7ebcea665bcca774428408fc32730505f4a06142.tar.gz timeline-7ebcea665bcca774428408fc32730505f4a06142.tar.bz2 timeline-7ebcea665bcca774428408fc32730505f4a06142.zip |
Implement data manager.
Diffstat (limited to 'Timeline/Entities')
-rw-r--r-- | Timeline/Entities/DataEntity.cs | 23 | ||||
-rw-r--r-- | Timeline/Entities/DatabaseContext.cs | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Timeline/Entities/DataEntity.cs b/Timeline/Entities/DataEntity.cs new file mode 100644 index 00000000..b21e2dbf --- /dev/null +++ b/Timeline/Entities/DataEntity.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Timeline.Entities
+{
+ [Table("data")]
+ public class DataEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Column("tag"), Required]
+ public string Tag { get; set; } = default!;
+
+ [Column("data"), Required]
+#pragma warning disable CA1819 // Properties should not return arrays
+ public byte[] Data { get; set; } = default!;
+#pragma warning restore CA1819 // Properties should not return arrays
+
+ [Column("ref"), Required]
+ public int Ref { get; set; }
+ }
+}
diff --git a/Timeline/Entities/DatabaseContext.cs b/Timeline/Entities/DatabaseContext.cs index 039cbd51..3ed61b71 100644 --- a/Timeline/Entities/DatabaseContext.cs +++ b/Timeline/Entities/DatabaseContext.cs @@ -21,5 +21,6 @@ namespace Timeline.Entities public DbSet<TimelinePostEntity> TimelinePosts { get; set; } = default!;
public DbSet<TimelineMemberEntity> TimelineMembers { get; set; } = default!;
public DbSet<JwtTokenEntity> JwtToken { get; set; } = default!;
+ public DbSet<DataEntity> Data { get; set; } = default!;
}
}
|