I am mounting my ID container using the Simple Injector, but it is giving a compilation error (Underline red) in the config. of the IReadOnlyRepository Interface with the ClientDapperRepository class. I think I'm doing something wrong but I do not know what is rsrsrs.
Does anyone know how to help me?
// Codes
public static Container RegisterServices(Container container)
{
//Domain to Repository
container.Register<IReadOnlyRepository, ClienteDapperRepository>(Lifestyle.Scoped);
return container;
}
public interface IReadOnlyRepository<TEntity> where TEntity : class
{
TEntity Get(int id);
IEnumerable<TEntity> All();
IEnumerable<TEntity> Find(Expression<Func<TEntity, bool>> predicate);
}
public class ClienteDapperRepository : Common.Repository, IClienteReadOnlyRepository
{
public IEnumerable<Cliente> All()
{
using (var cn = SistemaComercialConnection)
{
var cliente = cn.Query<Cliente>("Select * from Cliente");
return cliente;
}
}
}