Add Modifier model
This commit is contained in:
42
Elwig/Models/Modifier.cs
Normal file
42
Elwig/Models/Modifier.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Elwig.Models {
|
||||
[Table("modifier"), PrimaryKey("Year", "ModId")]
|
||||
public class Modifier {
|
||||
[Column("year")]
|
||||
public int Year { get; set; }
|
||||
|
||||
[Column("modid")]
|
||||
public string ModId { get; set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Column("abs")]
|
||||
public long? AbsValue { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public decimal? Abs {
|
||||
get {
|
||||
return AbsValue != null ? Season.DecFromDb((long)AbsValue) : null;
|
||||
}
|
||||
set {
|
||||
AbsValue = value != null ? Season.DecToDb((decimal)value) : null;
|
||||
}
|
||||
}
|
||||
|
||||
[Column("rel")]
|
||||
public double? Rel { get; set; }
|
||||
|
||||
[Column("standard")]
|
||||
public bool IsStandard { get; set; }
|
||||
|
||||
[Column("quick_select")]
|
||||
public bool IsQuickSelect { get; set; }
|
||||
|
||||
[ForeignKey("Year")]
|
||||
public virtual Season Season { get; private set; }
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user