tiny server.
This commit is contained in:
32
Server/Data/Model/FlowerItem.cs
Normal file
32
Server/Data/Model/FlowerItem.cs
Normal file
@ -0,0 +1,32 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user