Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Create IHostingEnvironment. #73

Merged
merged 1 commit into from
Sep 11, 2014
Merged

Create IHostingEnvironment. #73

merged 1 commit into from
Sep 11, 2014

Conversation

Tratcher
Copy link
Member

#71

{
public class HostingEnvironment : IHostingEnvironment
{
public HostingEnvironment()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed? (Don't really care either way.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea nuke this

@Tratcher
Copy link
Member Author

Updated.

1 similar comment
@Tratcher
Copy link
Member Author

Updated.

try
{
var config = new Configuration();
config.AddJsonFile("project.json");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path.Combine(applicationBasePath, "project.json")

@Tratcher
Copy link
Member Author

Updated.

var env = serviceProvider.GetService<IApplicationEnvironment>();
if (env == null)
var appEnv = serviceProvider.GetService<IApplicationEnvironment>();
if (appEnv == null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering - can the service be null? I thought DI throws if it's not registered. And that you have to ask for IEnumerable<T> to get 0 or more instances. Do we have a unit test for these scenarios?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't be null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, DI does throw now, I'll remove this old code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And add a test or two please!

@davidfowl
Copy link
Member

:shipit:

@davidfowl
Copy link
Member

After those changes

@Tratcher Tratcher merged commit 8a66871 into dev Sep 11, 2014
@Tratcher Tratcher deleted the WebRoot branch September 11, 2014 23:30
@Eilon
Copy link
Member

Eilon commented Sep 12, 2014

:shipit: me too, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants