[HttpGet]
public async Task<IActionResult> GetCarsAsync([FromQuery] GetCarsApiQuery query)
{
}
public class GetCarsApiQuery
{
public string? VehicleId { get; set; }
public VehicleType? VehicleType { get; set; } //Cannot change its type to string
}
public enum VehicleType {
Car,
Bike,
Undefined
}
[HttpGet]
public async Task<IActionResult> GetCarsAsync([FromQuery] GetCarsApiQuery query)
{
}
public class GetCarsApiQuery
{
public string? VehicleId { get; set; }
public VehicleType? VehicleType { get; set; } //Cannot change its type to string
}
public enum VehicleType {
Car,
Bike,
Undefined
}