I'm trying to implement the recording of the data in my views, and I'm having doubts about how to instantiate my% repository% in my controller, even using dependency injection examples, because in builder of my user repository he expects to receive an interface from my context.
How can I do in my controller to get access to Usuario
, add
, and so on.
My User Repository:
RepositoryBase<Usuario>, IUsuarioRepository
{
public UsuarioRepository(ILetsPartyContext context)
: base(context)
{
}
}
How I tried to implement however did not work.
public ILetsPartyContext _Context;
public UsuarioController(ILetsPartyContext Context)
{
_Context = Context;
}
UsuarioRepository rep = new UsuarioRepository(_Context);