My Swashbuckle.AspNetCore.Swagger have a problem

I have an API to convert currencies based on a local database. I create my controller, serive, repository and even though I can perform the query in the database I don’t get the same result via API.I’ve already spent a few hours trying to solve this and nothing seems to work, here’s the print.enter image description here. This case not is equals my problem because my swagger loads. This case not is equal my problem because i don’t care about swagger color.

My controller:

public class CurrencyController : ControllerBase
    public ObjectResult GetByCode([FromServices] CurrencyReadRepository repository, string code)
        return Ok(repository.GetCurrency(code));

>Solution :

You can try on StartUp.cs:


Leave a Reply