33 lines
825 B
C#
33 lines
825 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Blahblah.FlowerStory.Server.Data.Model;
|
|
|
|
[Table("flowers")]
|
|
public class FlowerItem
|
|
{
|
|
[Column("fid"), Key, Required]
|
|
public int Id { get; set; }
|
|
|
|
[Column("categoryid"), Required]
|
|
public int CategoryId { get; set; }
|
|
|
|
[Column("name"), Required]
|
|
public required string Name { get; set; }
|
|
|
|
[Column("datebuy"), Required]
|
|
public long DateBuyUnixTime { get; set; }
|
|
|
|
[Column("cost", TypeName = "real")]
|
|
public decimal? Cost { get; set; }
|
|
|
|
[Column("purchase")]
|
|
public string? Purchase { get; set; }
|
|
|
|
[Column("photo")]
|
|
public byte[]? Photo { get; set; }
|
|
|
|
[NotMapped]
|
|
public DateTimeOffset DateBuy => DateTimeOffset.FromUnixTimeMilliseconds(DateBuyUnixTime);
|
|
}
|