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

Action results pattern #657

@yishaigalatzer

Description

@yishaigalatzer

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions