private static void ConfigureServices(IServiceCollection serviceCollection) { configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetParent(AppContext.BaseDirectory).FullName) .AddJsonFile("appsettings.json", false) .Build(); ResolverType.Initialize(); ResolverType.MyContainer().Install(new ConfigurationInstallerFacade(configuration.GetConnectionString("pgConnection"))); ResolverType.MyContainer().Install(new AutoMapperInstaller()); }
static void Main(string[] args) { var connectionString = ConfigurationManager.ConnectionStrings["pgConnection"].ConnectionString; ResolverType.Initialize(); ResolverType.MyContainer().Install(new ConfigurationInstallerFacade(connectionString)); ResolverType.MyContainer().Install(new AutoMapperInstaller()); var logic = ResolverType.GetLogicFactory <ITestLogic>(); var cuentas = logic.GetCuentaContable(); foreach (var cuenta in cuentas) { Console.WriteLine($"Cuenta :{ cuenta.NumeroCuenta } - DescripciĆ³n: { cuenta.Descripcion }"); } Console.ReadKey(); }