This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
Enable creating a ViewResult without requiring a view engine #617
Comments
puncsky
changed the title
_serviceProvider, _viewEngine could be removed from Controller.cs
_serviceProvider and _viewEngine could be removed from Controller.cs
Jun 5, 2014
|
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.
danroth27
changed the title
_serviceProvider and _viewEngine could be removed from Controller.cs
ViewResult can be constructed without a view engine
Aug 17, 2014
danroth27
changed the title
ViewResult can be constructed without a view engine
Enable creating a ViewResult without requiring a view engine
Aug 17, 2014
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: