Estou tendo problemas ao mapear a Interface IClienteRepositoryInterface IClienteRepository
com a classe ClienteRepositoryClienteRepository
. Ao compilar a aplicação, aparece este erro:
"exception {"To be able to use the Lifestyle.Scoped property, please ensure that the container is configured with a default scoped lifestyle by setting the Container.Options.DefaultScopedLifestyle property with the required scoped lifestyle for your type of application. See: https://simpleinjector.org/lifestyles#scoped"} System.InvalidOperationException"
"exception {"To be able to use the Lifestyle.Scoped property, please ensure that the container is configured with a default scoped lifestyle by setting the Container.Options.DefaultScopedLifestyle property with the required scoped lifestyle for your type of application. See: https://simpleinjector.org/lifestyles#scoped"} System.InvalidOperationException"
Alguém sabe comoComo resolver?
public static Container RegisterServices(Container container)
{
//Domain to Repository
container.Register<IClienteRepository, ClienteRepository>(Lifestyle.Scoped);
return container;
}
public interface IClienteRepository : IRepository<Cliente>
{
}
public class ClienteRepository : Repository<Cliente>, IClienteRepository
{
public ClienteRepository(SistemaComercialContext context)
:base(context)
{
}
}
public static Container RegisterServices(Container container)
{
//Domain to Repository
container.Register<IClienteRepository, ClienteRepository>(Lifestyle.Scoped);
return container;
}
public interface IClienteRepository : IRepository<Cliente>
{
}
public class ClienteRepository : Repository<Cliente>, IClienteRepository
{
public ClienteRepository(SistemaComercialContext context)
:base(context)
{
}
}