aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Entities/UserAvatarEntity.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2020-02-01 00:26:35 +0800
committerGitHub <noreply@github.com>2020-02-01 00:26:35 +0800
commit7b962cd876719fb871569ba3c97fb5545721a3f8 (patch)
treef02f8d57440c777d4732bc4439f82e8b25c6732c /Timeline/Entities/UserAvatarEntity.cs
parent289c7e1fada1f4dae6ce5e421e997ebddd55c2df (diff)
parentbcb0a2361467614531a337282da1fd23996924f1 (diff)
downloadtimeline-7b962cd876719fb871569ba3c97fb5545721a3f8.tar.gz
timeline-7b962cd876719fb871569ba3c97fb5545721a3f8.tar.bz2
timeline-7b962cd876719fb871569ba3c97fb5545721a3f8.zip
Merge pull request #56 from crupest/dev
Refactor API to be RESTful.
Diffstat (limited to 'Timeline/Entities/UserAvatarEntity.cs')
-rw-r--r--Timeline/Entities/UserAvatarEntity.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/Timeline/Entities/UserAvatarEntity.cs b/Timeline/Entities/UserAvatarEntity.cs
new file mode 100644
index 00000000..6cecce1a
--- /dev/null
+++ b/Timeline/Entities/UserAvatarEntity.cs
@@ -0,0 +1,32 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace Timeline.Entities
+{
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "This is data base entity.")]
+ [Table("user_avatars")]
+ public class UserAvatarEntity
+ {
+ [Column("id"), Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public long Id { get; set; }
+
+ [Column("data")]
+ public byte[]? Data { get; set; }
+
+ [Column("type")]
+ public string? Type { get; set; }
+
+ [Column("etag"), MaxLength(30)]
+ public string? ETag { get; set; }
+
+ [Column("last_modified"), Required]
+ public DateTime LastModified { get; set; }
+
+ [Column("user"), Required]
+ public long UserId { get; set; }
+
+ [ForeignKey(nameof(UserId))]
+ public UserEntity User { get; set; } = default!;
+ }
+}