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

52 lines
1.1 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace SharedModels.DataTransferObjects.Model;
public class RouteAddressDto : CreateRouteAddressDto
{
public int Id { get; set; }
public RouteDto Route { get; set; } = null!;
public AddressDto Address { get; set; } = null!;
}
public class CreateRouteAddressDto
{
[Required]
public int RouteId { get; set; }
[Required]
public int AddressId { get; set; }
[Required]
[Range(0, Int32.MaxValue)]
public int Order { get; set; }
}
public class UpdateRouteAddressDto : CreateRouteAddressDto
{
[Required]
public int Id { get; set; }
}
public class CreateRouteAddressWithAddressDto
{
[Range(0, Int32.MaxValue)]
public int Order { get; set; }
public CreateAddressInRouteAddress? Address { get; set; }
public int? AddressId { get; set; }
}
public class RouteAddressWithAddressDto
{
public int Id { get; set; }
public int Order { get; set; }
public AddressInRouteAddress Address { get; set; } = null!;
public int AddressId { get; set; }
}