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

Moving IViewEngine to MvcOptions #726

Closed
wants to merge 3 commits into from
Closed

Moving IViewEngine to MvcOptions #726

wants to merge 3 commits into from

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Jul 1, 2014

No description provided.

@pranavkm
Copy link
Contributor Author

pranavkm commented Jul 1, 2014

First draft to vet design

/// <param name="descriptors">A list of ViewEngineDescriptors</param>
/// <param name="viewEngineType">Type representing an <see cref="IViewEngine"/>.</param>
/// <returns>ViewEngineDescriptor representing the added instance.</returns>
public static ViewEngineDescriptor Add([NotNull] this IList<ViewEngineDescriptor> descriptors,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a generic overload here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you mean? Nevermind figured it out. It just seems like more API surface for a very limited use API.

Copy link
Contributor

Choose a reason for hiding this comment

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

fair

_viewEngines = _viewEnginesProvider.ViewEngines;
}

return _viewEngines;
Copy link
Member

Choose a reason for hiding this comment

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

What does lazy-init buy us here? This service is only instantiated when we're actually going to execute a view right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We settled on this pattern with ModelBinders. I thought it made sense to keep it consistent.

But yes, in this case we don't benefit in any particular way.

@pranavkm
Copy link
Contributor Author

pranavkm commented Jul 8, 2014

Rebased and updated PR.

@rynowak
Copy link
Member

rynowak commented Jul 8, 2014

:shipit: once yishai is happy

@pranavkm pranavkm closed this Jul 9, 2014
@pranavkm pranavkm deleted the ViewEngine branch July 9, 2014 00:53
namespace Microsoft.AspNet.Mvc.Rendering
{
public class CompositeViewEngineTest
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing a few test cases:

  1. When there is a single view engine
  2. When the first view engine returns found

@yishaigalatzer
Copy link
Contributor

:shipit: but please followup with the test work before proceeding with new work

@pranavkm
Copy link
Contributor Author

pranavkm commented Jul 9, 2014

Fixed in #770

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.

4 participants