On an ASP.NET Core application I have the following action:
public async Task<IActionResult> Get() {
Reply reply = service.GetData();
return reply.Errors.Count > 0 ? HttpBadRequest(reply) : Ok(reply);
}
I get an error because HttpBadRequest and Ok are not of the same type.
I know I can use an IF but is there a way to create the response in a different way?