Models: Add Entities/ folder
This commit is contained in:
23
Elwig/Models/Entities/Currency.cs
Normal file
23
Elwig/Models/Entities/Currency.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using Elwig.Helpers;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Elwig.Models.Entities {
|
||||
[Table("currency"), PrimaryKey("Code")]
|
||||
public class Currency {
|
||||
[Column("code")]
|
||||
public string Code { get; private set; }
|
||||
|
||||
[Column("name")]
|
||||
public string Name { get; private set; }
|
||||
|
||||
[Column("symbol")]
|
||||
public string? Symbol { get; private set; }
|
||||
|
||||
[Column("one_euro")]
|
||||
public long? OneEuroValue { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public decimal? OneEuro => OneEuroValue != null ? Utils.DecFromDb(OneEuroValue.Value, 6) : null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user