Add Modifier model
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Elwig.Helpers;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Elwig.Models {
|
||||
@ -12,7 +14,7 @@ namespace Elwig.Models {
|
||||
public string CurrencyCode { get; set; }
|
||||
|
||||
[Column("precision")]
|
||||
public int Precision { get; set; }
|
||||
public byte Precision { get; set; }
|
||||
|
||||
[Column("start_date")]
|
||||
public string? StartDateString { get; set; }
|
||||
@ -42,5 +44,16 @@ namespace Elwig.Models {
|
||||
|
||||
[ForeignKey("CurrencyCode")]
|
||||
public virtual Currency Currency { get; private set; }
|
||||
|
||||
[InverseProperty("Season")]
|
||||
public virtual ISet<Modifier> Modifiers { get; private set; }
|
||||
|
||||
public decimal DecFromDb(long value) {
|
||||
return Utils.DecFromDb(value, Precision);
|
||||
}
|
||||
|
||||
public long DecToDb(decimal value) {
|
||||
return Utils.DecToDb(value, Precision);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user