Commit Graph

604 Commits

Author SHA1 Message Date
Ryan Nowak 2987f98283 Adding parameter replacement 2014-07-29 16:14:57 -07:00
Ryan Nowak 96c759e25c Add friendly name to action descriptor. Issue 820
Used in error messages for various attribute routing pieces, and anywhere
that you need a display name for an AD.
2014-07-29 15:21:34 -07:00
Ryan Nowak 2f9501458f Add friendly name to action descriptor. Issue 820
Used in error messages for various attribute routing pieces, and anywhere
that you need a display name for an AD.
2014-07-29 15:14:59 -07:00
sornaks cee73c0af3 1. Introducing XML Input Formatters.
2. Adding DelegatingStream class
3. Unit + Functional tests for formatters.
2014-07-29 15:04:23 -07:00
dougbu 43d1253936 Cleanup unused `FormContext` members due to legacy validation removal
- provide new property back for customer use
- remove unused FieldValidationMetadataClass
2014-07-29 10:44:12 -07:00
dougbu b5dcc9895d Fix #620, Remove legacy / non-unobtrusive client side validation
- remove `ViewContext.UnobtrusiveJavaScriptEnabled` property and all references
- avoid `ViewContext.GetFormContextForClientValidation()` calls since
  ternary expression is more explicit and we were inconsistent
- improve `ValidationMessage()` comments
- don't treat `ModelState.IsValid` as if it were still nullable
2014-07-29 10:43:19 -07:00
Javier Calvarro Nelson b0d52f73fd [Issue #527] Revive common ActionResults - Part 1.
1. Added HttpNotFound() to Controller.
2. Updated HttpStatusCodeResult to expose the StatusCode as a property.
3. Added unit tests for HttpNotFound() and for HttpStatusCodeResult.
4. Updated the MvcSample to add an action that uses HttpNotFound().
5. Brought back HttpNotFoundResult and added unit tests for it.
2014-07-25 13:04:59 -07:00
dougbu cd0285183e Fix StyleCop issues 2014-07-25 10:51:40 -07:00
Pranav K 24f74222f5 Introducing Controller.TryUpdateModel
This changeset reintroduces some of the overloads for
Controller.TryUpdateModel.

Fixes #415
2014-07-25 10:08:44 -07:00
Pranav K da0bf6f7d8 Commonizing code in option provider
* Adding ValueProviderFactoryProvider and CompositeValueProviderFactory to
  maintain parity in pattern with other option types.

Fixes #818
2014-07-25 06:52:00 -07:00
Pranav K 92e26cf8e0 RazorView should not create new ViewContext when rendering pages.
For pages that can pop back (e.g. Partial pages \ View Components), the
invoking component already creates a new ViewContext. ViewStart, Pages
and Layouts need to share the same Layout. This is required for sharing
ViewData values (such as title).

Fixes #861
2014-07-25 06:37:53 -07:00
dougbu 3746e44dc3 Add more `ModelMetadata` and HTML helper tests
- add `CachedDataAnnotationsMetadataAttributesTest`
- add `CachedDataAnnotationsModelMetadataTest`
- confirm more default property values in `ModelMetadataTest`
- confirm use of `DisplayName` in `ModelMetadataTest`
- add `HtmlHelperDisplayNameExtensionsTest`
- add `HtmlHelperLabelExtensionsTest`
- add `HtmlHelperNameExtensionsTest`
2014-07-24 18:32:35 -07:00
dougbu 48085eea08 Correct `ModelMetadata.IsRequired` to honour overrides
- subclasses would not calculate a value because `ModelMetadata` constructor
  set this property
- meant presence of a `[Required]` attribute in the model was ignored
2014-07-24 18:32:13 -07:00
dougbu 80a27c6f3b Add `ModelMetadata.DisplayName` property
- value comes from `Name` property of `[Display]` attribute
- use new property in `@Html.DisplayName()` and `@Html.Label()`; remove associated TODO comments
2014-07-24 18:31:48 -07:00
dougbu f4b582f654 Remove incorrect override of `ModelMetadata.GetDisplayName()`
- this method delegates to a number of `ModelMetadata` properties
- no use cases for overriding; should not be `virtual`
- `ModelMetadata.DisplayName` override using `DisplayAttribute.GetName()` coming in next commit
2014-07-24 16:49:02 -07:00
harshgMSFT b1912d799c Moving to RandomNumberGenerator as CryptRandom is not supported in Mono 2014-07-24 14:07:58 -07:00
Pranav K 47d227cbf2 Modify FindView and FindPartialView to accept ActionContext
Fixes #787
2014-07-24 11:48:23 -07:00
harshgMSFT a2561281b7 Adding MvcOptions.OutputFormatters property. 2014-07-23 17:46:17 -07:00
harshgMSFT 8ed7dadfd8 Fixing project.json in Mvc 2014-07-23 17:22:46 -07:00
harshgMSFT 1df4738a19 Adding OutputFormatter base class 2014-07-23 16:50:22 -07:00
Pranav K e28adbfb3d ViewStarts need to be executed as part of View execution
Fixes #834
2014-07-23 16:45:25 -07:00
harshgMSFT b8ab5c5063 Http Abstractions for parsing Http headers needed for conneg. 2014-07-23 16:28:32 -07:00
Ryan Nowak d13f6474d8 adding a few tests for areas 2014-07-21 14:52:44 -07:00
Ryan Nowak 1b07c89322 cr feedback 2014-07-21 14:52:41 -07:00
Ryan Nowak 745239f09f Adding Attribute Routing Link Generation 2014-07-21 14:52:38 -07:00
Pranav K 340bd7550a Adding RazorView to Microsoft.AspNet.Mvc.Razor
RazorView was part of the previous commit but was separated to make it
easier to see the diff in RazorPage that was formerly named RazorView

Adding IRazorPage and changes per code review comments
2014-07-18 21:14:45 -07:00
Pranav K 9e535f6897 Separating view execution and Razor behavior
* Introducing RazorPage and RazorPageOfT that represent the Razor
  execution aspect of view execution. Moving view execution hierarchy behavior
  (Layout, partial views etc) into a separate RazorView type.

* Renaming IVirtualPathViewFactory to IRazorPageFactory,
  IRazorViewActivator to IRazorPageActivator

* Renaming VirtualPathViewFactor to FileBasedPageFactory to
  correctly reflect what it does.

Fixes #814
2014-07-18 14:58:12 -07:00
Pranav K c1112fcaf1 Move ValueProviders to MvcOptions
Fixes #778
2014-07-17 21:02:47 -07:00
Pranav K d619b0df3b Reacting to System.Security.Cryptograph.Encryption package rename 2014-07-17 09:28:25 -07:00
Ryan Nowak bff94f169f Fix for issue #610 - Ignore internal and nested types
This change exludes internal and nested types from being treated as
controllers. This is consistent with MVC5's behavior.

DefaultActionSelectionConventions was primarily tested through running
action selection. I wanted to also test the methods with substantial logic
in this class, so I moved a spate of a classes from private classes inside of the
integration tests to public classes so they could be shared. I also added
tests to fill gaps in DefaultActionSelectionConventions, which is the vast
vast majority of this change.
2014-07-16 16:33:26 -07:00
Pranav K 9f8c656b31 IUrlHelper and IViewComponentHelper need to be activated
* Removing Init method and using [Activate] to activate IUrlHelper.
* Moving IViewComponentHelper to default injected properties
* Adding functional tests to verify these properties are injected \
  activated

Fixes #789
2014-07-16 16:24:03 -07:00
Yishai Galatzer 472e500864 Cache file info access in viewengine
Move compilation and VirtualPathViewFactory to be singletons
And cache access to files.

The cache time is controlled by MVC options.
The cache is implemented in the ExpiringFileInfoCache.cs
2014-07-16 13:12:21 -07:00
Javier Calvarro Nelson 87c430ae19 [#732] Attribute Routing: Implement `~/` for overriding a prefix
This change allows a user to override a route prefix set using
[Route("...")] on the controller by providing a route template
on the action that starts with "~/" or "/". For example,
[HttpGet("~/...")] or [HttpGet("/...")]

If the user specifies a template in [Route] that starts with "~/"
or "/", we will just strip the prefix from the template and use
the remaining part of the template.

The reason to do this is that there's a reasonable extensibility
scenario where a user can implement a global prefix for routes as
a convention (using IReflectedApplicationModelConvention), and use
~/ to escape that prefix (just like we support with action-level routes).
2014-07-16 09:40:38 -07:00
Pranav K bbdb2dfbf2 Adding support for activating view properties
Fixes #700
2014-07-15 16:26:07 -07:00
Pranav K f6106e424e Reacting to System.Collections versioning change 2014-07-14 15:54:00 -07:00
Pranav K 65dfbed8d8 Reacting to System.Collections version change 2014-07-14 15:19:32 -07:00
Pranav K 3692cc7d83 Revert "Adding support for activating view properties"
This reverts commit 21bb8cb9fb.
2014-07-14 11:42:41 -07:00
Pranav K 21bb8cb9fb Adding support for activating view properties
Fixes #700
2014-07-14 10:40:07 -07:00
David Fowler 7e7c56ce48 Renamed configurations to frameworks in project.json 2014-07-13 21:58:12 -07:00
sornaks 720923a1a4 Moving UTF8EncodingWithoutBOM.cs to Common and renaming it as Encodings. 2014-07-10 10:47:54 -07:00
David Fowler b1c0792e8c Added Configuration to TestApplicationEnvironment 2014-07-10 10:22:24 -07:00
Yishai Galatzer 039762c497 Remove unnecessary awaits to speed up cold startup time.
The await/async patterns adds a state machine that takes time to jit, in this
case the await is not necessary and the code remains simple without adding
continuations.
2014-07-10 09:42:08 -07:00
Pranav K 177aadeadf Add extra unit tests and functional tests for CompositeViewEngine
Fixes #768
2014-07-09 15:03:34 -07:00
Pranav K 23eefed31a Move setting up options to MvcOptionsSetup
Fixes #760
2014-07-09 09:45:17 -07:00
Pranav K 5194adfaf5 Moving IViewEngine to MvcOptions 2014-07-08 17:50:13 -07:00
Ryan Nowak 6c5b836070 Removing magic link generation 2014-07-08 12:17:49 -07:00
Pranav K dbd26ef9a3 Chaning unit test to use Mock.Setup instead of setting it directly 2014-07-08 11:46:47 -07:00
Chris Ross 93869a5d7b Fix test. 2014-07-08 10:40:06 -07:00
Chris Ross 240d969899 Add using statement for extension methods. 2014-07-08 10:19:16 -07:00
tugberkugurlu 8e0876e440 sorted dependencies corrctly on sample 2014-07-07 22:21:35 +03:00