auto.bus_api/SharedModels/DataTransferObjects/DatabaseModels/RouteDto.cs

32 lines
682 B
C#

using System.ComponentModel.DataAnnotations;
namespace SharedModels.DataTransferObjects.Model;
public class RouteDto : CreateRouteDto
{
public int Id { get; set; }
}
public class CreateRouteDto
{
[Required]
public string Type { get; set; } = null!;
}
public class UpdateRouteDto : CreateRouteDto
{
[Required]
public int Id { get; set; }
}
public class CreateRouteWithAddressesDto : CreateRouteDto
{
[Required]
[MinLength(2)]
public IList<CreateRouteAddressWithAddressDto> RouteAddresses { get; set; } = null!;
}
public class RouteWithAddressesDto : RouteDto
{
public IList<RouteAddressWithAddressDto> RouteAddresses { get; set; } = null!;
}