Answer the question
In order to leave comments, you need to log in
How to return structures of different types from a method?
Complete zero in C#. I have a method that makes an asynchronous API request to a specific endpoint. The API can return both a BaseResponseModel and an ErrorModel. The method needs to be able to return Task<BaseResponseModel<SomeModel>>
or Task<ErrorModel>
. How can this be implemented?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question