see file configuration repository
@sharpn spotted this at work! Need to support configuration.dev.json etc the problem is in the FileConfigurationRepository because it hard codes configuration.json in there...sigh at me.
Hi Tom,
I have a lot to learn but I'd still like to contribute in small ways.
@hemantkd all contributions are welcome! Would you like some more information about this issue?
Are you thinking merge/override configuration files like appsettings or a single configuration based on environment?
I'm not sure at the moment, will have a think!
How about something of this form:
public Response
{
var configFilePath = $"{AppContext.BaseDirectory}/configuration.{enviromentName}.json";
.
.
.
}
Similarly for the Set method in the FileConfigurationRepository.
Would this work, to at least give an environment based support?
@hemantkd yep I think it might work! Give it a try if you have time.
Could also pass ihostingenvironment into the class and get the environmentname property.
@TomPallister Cool. Will give it a go as soon as I find some time.
The related unit tests could use some refactoring before I make any changes to the code, I think.
@dbarkwell not sure if need the dependency on ihostingenvironment when all we will be using really is just one property from it?
@hemantkd you'd have to change the interface to implement your solution. would be easier to make the change on the concrete class. just my $0.02.
@TomPallister what do you say? :)
try both and see what you prefer..
My guess is ihostingenvironment passed into the constructor would be better and follow the standards.
Sure, I'm here to play and learn.
Can you please shed some light on what standard is that specifically so that I can read about it?
Trying to unlearn the bad ways and learn the good ways. :)
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments
and then you can use the ihostingenvironment to get the current environment and append it to any configuration files you want to use! such as appsettings!
@TomPallister I have not used Git for collaborative work before and have never contributed before too. I'm using Visual Studio 2017 and the steps from https://docs.microsoft.com/en-us/vsts/git/gitquickstart?tabs=visual-studio. Apologies for my lack of knowledge but I never had an opportunity to use Git at work.
I have created a local branch named 'feautre/fix-#147'. Made the code changes. Done 'Commit All'.
And have done push.
I feel that I have messed it up as I'm using it for the first time :(
Can you check from your side that I haven't done anything wrong?
@hemantkd don't worry you can't mess to much up with git!
Did you fork Ocelot? If not then you want to do this because you cannot make any changes to the ocelot repository.
Basically you fork (copy) Ocelot into your github account. You make changes to that repo. Then when you are happy you open a pull request against my ocelot repo. I will review the code and when all is good merge the changes from your fork into ocelot.
Does that make sense?