auto.bus_api/SharedModels/DataTransferObjects/CityDto.cs
cuqmbr 95028ed18b feat: many thing
- Database model
- Data transfer objects
- Country management controller
2022-10-10 20:34:09 +03:00

22 lines
512 B
C#

using System.ComponentModel.DataAnnotations;
namespace SharedModels.DataTransferObjects;
public class CityDto : CreateCityDto
{
public int Id { get; set; }
public StateDto State { get; set; } = null!;
public virtual IList<AddressDto>? Addresses { get; set; }
}
public class CreateCityDto
{
[Required]
[StringLength(maximumLength: 40, ErrorMessage = "City Name is too long")]
public string Name { get; set; } = null!;
[Required]
public int StateId { get; set; }
}