CodeLiturgy.Dashboard/BlueWest.Data/Country/Country.cs

48 lines
1.1 KiB
C#

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using MapTo;
namespace BlueWest.Data
{
[MapFrom(new []
{
typeof(CountryUpdate),
typeof(CountryCreate),
typeof(CountryUnique)
})]
public partial class Country
{
/// <summary>
/// ISO 3166-1 numeric code
/// Primary key.
/// </summary>
public int Code { get; set; }
/// <summary>
/// ISO 3166-1 State Name
/// </summary>
public string StateName { get; set; }
[MaxLength(2)] public string Alpha2Code { get; set; }
public string TLD { get; set; }
public List<Currency> Currencies { get; set; }
public List<User> Users { get; set; }
[JsonConstructor]
public Country(int code, string stateName, string tld, List<Currency> currencies)
{
Code = code;
StateName = stateName;
TLD = tld;
Currencies = currencies;
}
public Country() { }
}
}