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

Inject the IRazorViewEngine directory instead of using GetRequiredService #4731

Merged
merged 1 commit into from
May 24, 2016

Conversation

pranavkm
Copy link
Contributor

No description provided.

@pranavkm
Copy link
Contributor Author

cc @rynowak

public MvcRazorMvcViewOptionsSetup(IServiceProvider serviceProvider)
: base(options => ConfigureMvc(serviceProvider, options))
/// <param name="razorViewEngine">The <see cref="IRazorViewEngine"/>.</param>
public MvcRazorMvcViewOptionsSetup(IRazorViewEngine razorViewEngine)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's two other places where we use IServiceProvider, but there's slightly more involved since they use GetService instead of GetRequiredService to get an optionally injected feature. We'd have to use constructor overloading to make those work correctly.

Copy link
Member

Choose a reason for hiding this comment

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

Would our lives here be simpler if we got rid of the ConfigureOptions base class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rynowak
Copy link
Member

rynowak commented May 24, 2016

:shipit:

@pranavkm pranavkm merged commit 90f0e29 into dev May 24, 2016
@pranavkm pranavkm deleted the prkrishn/mvcrazoroptionsetup branch May 24, 2016 18:54
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