-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskCommentEntity.cs
More file actions
25 lines (22 loc) · 971 Bytes
/
TaskCommentEntity.cs
File metadata and controls
25 lines (22 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.ComponentModel.DataAnnotations.Schema;
using TaskSync.Models.Enums;
namespace TaskSync.Repositories.Entities
{
[Table("task_comments")]
public class TaskCommentEntity
{
[Column("id")] public int Id { get; set; }
[Column("task_id")] public int TaskId { get; set; }
[Column("commenter_id")] public int? CommenterId { get; set; }
[Column("type")] public required string TypeRaw { get; set; }
[Column("created_at")] public DateTime CreatedAt { get; set; }
[Column("comment_text")] public required string CommentText { get; set; }
[Column("metadata")] public required Dictionary<string, object> MetaData { get; set; }
[NotMapped]
public TASK_COMMENT_TYPE Type
{
get => Enum.Parse<TASK_COMMENT_TYPE>(TypeRaw, ignoreCase: true); // Read from DB
set => TypeRaw = value.ToString().ToLower(); // Write to DB
}
}
}