I used Nswag studio and I generated related codes to my Api . I used Asp .Net 6 MVC as place to add the out put of nswage studio codes.
in program.cs file I registered the DI with this code :
builder.Services.AddHttpClient<IClient, Client>(cl => cl.BaseAddress = new Uri("https://localhost:7181"));
However ,when I used this Iclient interface in my controllers or outher class I faced with this error (I used them by constructor injection) :
InvalidOperationException: Unable to resolve service for type 'System.String' while attempting to activate 'GymManagement.UI.Asp.NetMVC.Services.Base.Client'.
I used Nswag studio and I generated related codes to my Api . I used Asp .Net 6 MVC as place to add the out put of nswage studio codes. in program.cs file I registered the DI with this code :
builder.Services.AddHttpClient<IClient, Client>(cl => cl.BaseAddress = new Uri("https://localhost:7181"));
However ,when I used this Iclient interface in my controllers or outher class I faced with this error (I used them by constructor injection) : InvalidOperationException: Unable to resolve service for type 'System.String' while attempting to activate 'GymManagement.UI.Asp.NetMVC.Services.Base.Client'.