1
Inconsistent accessibility: "Iclientmanager" parameter type is less accessible than "Clientecontroller.Clientcontroller(Iclientmanager, Usermanager)
Controller:
public class ClientController : Controller
{
private readonly IClientManager _clientManager;
private readonly UserManager<ApplicationUser> _userManager;
public ClientController( <- Erro está aqui
IClientManager clientManager,
UserManager<ApplicationUser> userManager)
{
_clientManager = clientManager;
_userManager = userManager;
}
}
Iclientmanager:
internal interface IClientManager : IDisposable
{
Task<ApplicationClient> CreateClientAsync(ApplicationClient client);
}
Startup:
services.AddScoped<IClientManager, ClientManager>();
Clientmanager:
public class ClientManager : IClientManager
{
private ApplicationDbContext _context;
public ClientManager(ApplicationDbContext context)
{
_context = context;
}
public async Task<ApplicationClient> CreateClientAsync(ApplicationClient client)
{
var result = await _context.Clientes.AddAsync(client);
if (result.State == EntityState.Added)
{
_context.SaveChanges();
}
return result.Entity;
}
}
Now gave the following message
Mais de um modificador de proteção
– Matheus
sorry there was an error in the reply, already corrected
– Ricardo Pontual
Now it worked perfectly
– Matheus