This repository was archived by the owner on Dec 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Enable creating a ViewResult without requiring a view engine #617
Comments
|
The advantage of it would be the ability to just say We could keep both overloads but it's a little strange to have an optional service passed. |
I had to deal with this when working with Activate (https://github.com/aspnet/Mvc/pull/648/files#r13678472). A POCO controller is forced to activate the service provider + ViewEngine to be able to produce a View rather than call the view result which eventually does have enough knowledge to obtain these values. |
this is happening. |
rynowak
added a commit
that referenced
this issue
Jun 28, 2014
We want result types to be constructable without services.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
After "#597 Remove ActionResultHelper", helpers in
ActionResultHelper
are merged toController.cs
.We find that actually
return new ViewResult(_serviceProvider, _viewEngine)
inpublic ViewResult View(string view, object model)
is useless. Andreturn new ViewResult()
is enough becauseViewResult
itself has DI on its ctor and the services can be reached throughContext.ApplicationServices
.The text was updated successfully, but these errors were encountered: