static void Main(string[] args) { var container = new ContainerBuilder(); var build = Contenedor.contains(container).Build(); var repositorio = build.Resolve <IPersonaRepositorio>(); var persona = new PersonaNegocio(repositorio); var Lista = persona.ListarPersonas(); }
static void Main(string[] args) { var builder = new ContainerBuilder(); Contenedor.contains(builder); IContainer Container = builder.Build(); var repositorio = Container.Resolve <IPersonaRepositorio>(); var personanegocio = new PersonaNegocio(repositorio); var Lista = personanegocio.Lista(); Console.WriteLine(); Console.ReadLine(); }
static void Main(string[] args) { /********************Creando Objeto*********************/ //var Venta = new Venta(new Factura()); /******************Usando Contenedor IoC*******************/ var builder = new ContainerBuilder(); Contenedor.contains(builder); IContainer Container = builder.Build(); var Factura = Container.Resolve <IFactura>(); var venta = new Venta(Factura); Console.WriteLine(venta.RealizarVenta()); Console.ReadLine(); }