Skip to content

Instantly share code, notes, and snippets.

@jesuscampos
Last active December 9, 2017 13:56
Show Gist options
  • Save jesuscampos/103130b9267fac200d7b5eb5c7847d1b to your computer and use it in GitHub Desktop.
Save jesuscampos/103130b9267fac200d7b5eb5c7847d1b to your computer and use it in GitHub Desktop.
// 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