Created
July 30, 2024 17:49
-
-
Save alefra88/09092f6fa67cb2009c1f5cf35c6e686e to your computer and use it in GitHub Desktop.
Constructor que recibe cadena de conexión desde appsettings.json y que usa el objeto ConfigurationBuilder
This file contains 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
//En el método constructor se cargará la URL de la web api que se especifico en appsettings.json | |
//para esto se utiliza un objeto ConfigurationBuilder | |
var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json").Build(); | |
_urlWebAPI = builder.GetSection("urlWebAPI").Value; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment