-
-
Save jesuscampos/103130b9267fac200d7b5eb5c7847d1b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Registramos el tipo en el contenedor | |
container.RegisterType<IRepositorioPedidos, RepositorioPedidos>(); | |
// Resolvemos usando Lazy<T> | |
var objetoLazy = container.Resolve<Lazy<IRepositorioPedidos>>(); | |
// Al usar el objeto por primera vez mediante la propiedad Value se crerá la instancia | |
var miObjeto = objetoLazy.Value; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment