Im using nswag with a angular2 typescript application and would like to return a generic type or 'any' in typescript from the WebAPI:
public async Task<T> GetSomeInput(SomeInput input)
{
if (input == "Car")
{
var result = await _repository.GetAsync<Car>(input);
return result.MapTo<CarDto>();
}
if (input == "Bike")
{
var result = await _repository.GetAsync<Bike>(input);
return result.MapTo<BikeDto>();
}
}
So in the angular side i make the cast. Is there a way to do that?