auto.bus_razor/TicketOffice/Models/Route.cs
2022-03-26 22:25:46 +02:00

23 lines
615 B
C#

using System.ComponentModel.DataAnnotations;
namespace TicketOffice.Models;
public class Route
{
[Key]
public int Id { get; set; }
[Required]
[StringLength(4, ErrorMessage = "Route number must be 4"), MinLength(4, ErrorMessage = "Route number must be 4")]
public string Number { get; set; }
public ICollection<City>? Cities { get; set; }
[Required]
[Range(5, 50, ErrorMessage = "Capacity must be between 5 and 50")]
public int Capacity { get; set; }
public int RemainingCapacity { get; set; }
public ICollection<Ticket>? Tickets { get; set; }
}