This repository has been 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
Action results pattern #657
Comments
Needs discussion and break down. |
This was referenced Oct 13, 2014
Doing a pass and cleaning this up things that should be true in general. Properties are get/set by default
Exception to this is Adding a |
rynowak
added a commit
that referenced
this issue
Jan 16, 2015
In general all properties are get/set so filters can change them. - some validate for not-null - where we use services it's get/set also Services are resolved in the Execute method if not provided. A few more ActionResults that return a body have the ability to set a status code now (optional).
rynowak
added a commit
that referenced
this issue
Jan 16, 2015
In general all properties are get/set so filters can change them. - some validate for not-null - where we use services it's get/set also Services are resolved in the Execute method if not provided. A few more ActionResults that return a body have the ability to set a status code now (optional).
rynowak
added a commit
that referenced
this issue
Jan 17, 2015
In general all properties are get/set so filters can change them. - some validate for not-null - where we use services it's get/set also Services are resolved in the Execute method if not provided. A few more ActionResults that return a body have the ability to set a status code now (optional).
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Examples:
JsonResult
allow status code on JsonResult.RedirectResult
exposes the url but doesn't let you change it.Also
redirectresult
eagerly resolves UrlHelper just to find out if a Url is local (which means a service is resolved on every call unnecessarily).See:
https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNet.Mvc.Core/ActionResults/RedirectResult.cs#L35
Suggested pattern: Every result exposes properties as get set, so results filters can modify them and observe the values.
Services are resolved on a per needed basis, and not eagerly.
Static things like IsLocalUrl are not done as Transient services, they can either be static methods or Singleton services.
The text was updated successfully, but these errors were encountered: