roadie/Roadie.Api.Library/Data/CommentReaction.cs

23 lines
793 B
C#
Raw Normal View History

2019-07-03 16:21:29 +00:00
using Roadie.Library.Identity;
2019-06-28 21:24:32 +00:00
using Roadie.Library.Utility;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Roadie.Library.Data
{
[Table("commentReaction")]
2019-07-03 16:21:29 +00:00
public class CommentReaction : EntityBase
2019-06-28 21:24:32 +00:00
{
public Comment Comment { get; set; }
2019-07-03 16:21:29 +00:00
[Column("commentId")] [Required] public int CommentId { get; set; }
[NotMapped] public new bool? IsLocked { get; set; }
[Column("reaction")] public string Reaction { get; set; }
2019-06-28 21:24:32 +00:00
[NotMapped]
2019-07-03 16:21:29 +00:00
public Enums.CommentReaction ReactionValue => SafeParser.ToEnum<Enums.CommentReaction>(Reaction ?? "Unknown");
2019-06-28 21:24:32 +00:00
2019-07-03 16:21:29 +00:00
public ApplicationUser User { get; set; }
[Column("userId")] [Required] public int UserId { get; set; }
2019-06-28 21:24:32 +00:00
}
}