flower-story/Server/Data/Model/RecordItem.cs
2023-05-23 08:37:20 +08:00

30 lines
707 B
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Blahblah.FlowerStory.Server.Data.Model;
[Table("records")]
public class RecordItem
{
[Column("rid"), Key, Required]
public int Id { get; set; }
[Column("eid"), Required]
public int EventId { get; set; }
[Column("date"), Required]
public long DateUnixTime { get; set; }
[Column("byuid")]
public int? ByUserId { get; set; }
[Column("byname")]
public string? ByUserName { get; set; }
[Column("photo")]
public byte[]? Photo { get; set; }
[NotMapped]
public DateTimeOffset Date => DateTimeOffset.FromUnixTimeMilliseconds(DateUnixTime);
}