kara
kara

Reputation: 3455

How to define Environments and Constants in LinqPad6?

I use LinqPad to query data from microservices. My problem is that i've got 3 environments (test, integration, production). Every environment has it's own configuration (URLs, Users etc.).

Is it possible to create some kind of environment-constants for my LinqPad-Scripts?

My config could look like this:

Test:

{
    "productServiceUrl"="myDevServer.com/product.service",
    "User"="DevUser",
    "Password"="TopSecret"
}

Int:

{
    "productServiceUrl"="myIntServer.com/product.service",
    "User"="IntUser",
    "Password"="TopSecret2"
}

Prod:

{
    "productServiceUrl"="myProdServer.com/product.service",
    "User"="ProdUser",
    "Password"="TopSecret3"
}

And in myscript is want to user something like this:

var myProductService = new MyProductClient(CurrentEnvironmentConfig.ProductServiceUrl);

Upvotes: 0

Views: 205

Answers (0)

Related Questions