You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
using System.ComponentModel.DataAnnotations;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace BlazorFluentUI.Models
|
|
{
|
|
[RequiresUnreferencedCode("Necessary because of RangeAttribute usage")]
|
|
public class Starship
|
|
{
|
|
[Required]
|
|
[MinLength(3, ErrorMessage = "Identifier is too short")]
|
|
[StringLength(16, ErrorMessage = "Identifier is too long (16 character limit)")]
|
|
public string? Identifier { get; set; }
|
|
|
|
public string? Description { get; set; }
|
|
|
|
[Required(ErrorMessage = "Countries are required")]
|
|
public IEnumerable<Country> Countries { get; set; }
|
|
|
|
[Required(ErrorMessage = "A classification is required")]
|
|
public string? Classification { get; set; }
|
|
|
|
[Required]
|
|
[Range(1, 100000, ErrorMessage = "Accomodation invalid (1-100000)")]
|
|
public int MaximumAccomodation { get; set; }
|
|
|
|
[Required]
|
|
[Range(typeof(bool), "true", "true", ErrorMessage = "This form disallows unapproved ships")]
|
|
public bool IsValidatedDesign { get; set; }
|
|
|
|
[Required]
|
|
public DateTime? ProductionDate { get; set; }
|
|
|
|
public bool HasTeleporter { get; set; }
|
|
}
|
|
}
|
|
|