tiny server.
This commit is contained in:
45
App/Data/Model/FlowerItem.cs
Normal file
45
App/Data/Model/FlowerItem.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using SQLite;
|
||||
|
||||
namespace Blahblah.FlowerStory.Data.Model;
|
||||
|
||||
[Table("flowers")]
|
||||
public class FlowerItem
|
||||
{
|
||||
[Column("fid"), PrimaryKey, AutoIncrement]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("categoryid")]
|
||||
public int CategoryId { get; set; }
|
||||
|
||||
private string categoryName;
|
||||
public string CategoryName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (categoryName == null)
|
||||
{
|
||||
if (!Constants.Categories.TryGetValue(CategoryId, out categoryName))
|
||||
{
|
||||
categoryName = Constants.CategoryOther;
|
||||
}
|
||||
// TODO: i18n
|
||||
}
|
||||
return categoryName;
|
||||
}
|
||||
}
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Column("datebuy")]
|
||||
public DateTimeOffset DateBuy { get; set; }
|
||||
|
||||
[Column("cost")]
|
||||
public decimal? Cost { get; set; }
|
||||
|
||||
[Column("purchase")]
|
||||
public string Purchase { get; set; }
|
||||
|
||||
[Column("photo")]
|
||||
public byte[] Photo { get; set; }
|
||||
}
|
Reference in New Issue
Block a user