Commit Graph

1741 Commits

Author SHA1 Message Date
Doug Bunting 8a701726b3 Rename _GlobalImport.cshtml files to _ViewImports.cshtml
- also rename files and directories with "GlobalImport" in name
 - nearly blind but avoid "ViewImportss" in new names
- public API change: `ViewHierarchyUtility.GetGlobalImportLocations()` -> `GetViewImportsLocations()`
 - primary source updates were comments, tests, and implementation details

nit:
- rename NestedGlobalImports.cs file to NestedViewImportsController.cs, matching class
2015-05-21 12:27:08 -07:00
Kirthi Krishnamraju 78033fda1f fix build break 2015-05-21 11:25:03 -07:00
Doug Bunting 517c013882 React to aspnet/Razor#89 fix
- use `IDictionary<string, TValue>` support in `<a/>` and `<form/>` tag helpers
 - make `RouteValues` dictionaries `IDictionary<string, string>` for ease of use
- remove `TagHelperOutputExtensions.FindPrefixedAttributes()`
- set all `GeneratedTagHelperContext` properties
- add error for tag helper dictionary properties where `TValue` is `ModelExpression`
- add new `RazorPage.InvalidTagHelperIndexerAssignment()` method and resource

tests
- use new `isIndexer` argument when creating `TagHelperAttributeDescriptor`
- arrange `AnchorTagHelper` and `FormTagHelper` correctly
 - also expect `routeValues != null` in calls to `IHtmlGenerator`

nits:
- get rid of some `foo` and `bar` gunk in tests
- remove unused variable to cleanup a test compilation warning
2015-05-20 22:07:19 -07:00
Kirthi Krishnamraju 337bbad51d React to aspnet/Configuration #195,#198 and fix few minor build break issues 2015-05-20 20:01:23 -07:00
Ryan Nowak fa56df93c3 Fix #2407 - Part 1 - Make model binding behavior for [Required] compatible
with MVC5.

This change removes the behavior in model binding to validate values 'on
the wire' for requiredness instead of the looking at the model. This
restores the behavior of [Required] for model binding to the MVC5
semantics.
2015-05-19 15:57:56 -07:00
Ajay Bhargav Baaskaran 48e0b3261c [Fixes #2547] Fixed attribute value prefix with dynamic content being ignored 2015-05-18 17:15:38 -07:00
N. Taylor Mullen a0813faa48 React to default hosting environment change.
- Default hosting environment was changed from Development to Production, modified EnvironmentTagHelper functional test.
2015-05-18 16:16:17 -07:00
Ajay Bhargav Baaskaran 47bfba11b9 React to aspnet/Razor#217 fix 2015-05-15 12:28:43 -07:00
Harsh Gupta d0927bdc75 Fixes #2464 - Does not add extra skipped entries for model bound from services.
Also ensures that when a type is marked as skipped, any sub property which is model bound (and hence a modelstate un validated entry),
is marked as skipped (otherwise it would cause the ModelState to be invalid).
Also fixing a bug in model state dictionary FindKeyWithPrefix was not considering [0] & [0][0] as a valid prefix.
2015-05-15 12:27:43 -07:00
Harsh Gupta 88ac4b94e4 Fixing #2466, #2446.
The assumption is ModelState should have entries if
1. An error is explicitly added by a model binder.
2. There is validation error reported while validating the model.
3. There is value bound by the model binder.

With this change there should be no extra entry other than for the cases mentioned above.

Also enabling the integration test cases.
2015-05-15 12:27:41 -07:00
N. Taylor Mullen 12e4307f3a Add tests to account for aspnet/Razor#220.
- Added unit and functional test.
2015-05-15 12:13:15 -07:00
N. Taylor Mullen 247625dcab React to aspnet/Razor#220.
- Added the ability for the WriteTagHelperAsync in RazorPage.cs to understand minimized attributes.
2015-05-15 12:13:10 -07:00
Kiran Challa 6ef8be92ff [Fixes #2541] Use custom stream writer for Xml output formatters 2015-05-15 12:12:11 -07:00
Harsh Gupta 22f1881cc6 Restoring modelvalidation node. 2015-05-14 18:38:26 -07:00
Kirthi Krishnamraju 8b5223518f Fix 2224: [Jsonpatch]Added tests for custom converters on properties 2015-05-14 17:18:42 -07:00
Ajay Bhargav Baaskaran 39642761b1 Added overload to ViewComponent.Json to accept JsonSerializerSettings 2015-05-14 15:45:41 -07:00
Ryan Nowak 7767251dad Adding some deserialization to a test for SerializableError 2015-05-14 15:38:50 -07:00
Ryan Nowak cc4ee1068d Fix #2414 Part 2 - Add [DefaultValue(...)] support to the invoker for
action parameters
2015-05-14 13:58:02 -07:00
Ryan Nowak 2fc983b23a Fix for #2414 - Remove [DefaultValue] support from ModelBinding
This part of the change removes default value support from ModelBinding.

Updated some unit tests to verify that it does nothing in that case.
Deleted a functional test as it was pure duplication of another
(supported) case where the property has a pre-initialized value.
2015-05-13 20:03:23 -07:00
Hao Kung 1ea1cc4338 AuthorizeFilter should always set default identity 2015-05-13 16:39:35 -07:00
N. Taylor Mullen 8ec28463fc Update .travis.yml to use working version of mono.
- Non 3.12.0 versions cause unexpected end of file stream exception.
2015-05-13 16:34:20 -07:00
Ryan Nowak 90805fa827 Pass InputFormatters in OBC
This removes the need to use IScopedInstance<ActionBindingContext> to get
access to the formatters.
2015-05-13 16:02:34 -07:00
Eilon Lipton 4b1a708ba1 Merge pull request #2398 from henkmollema/fix-1743
Added new ValidationSummary overloads to sample
2015-05-13 15:15:36 -07:00
Kiran Challa 4bed2e6f2b [Fixes #2545] RedirectToRouteResult doesn't use RouteName property when calculating destination URL 2015-05-13 12:35:25 -07:00
Kirthi Krishnamraju da740cd6a8 fix #2535: Timezone test failure in Microsoft.AspNet.Mvc.Core.Tests 2015-05-13 10:06:26 -07:00
Hao Kung b2318bc471 React to security API changes 2015-05-12 15:12:06 -07:00
Kirthi Krishnamraju caa8ea44fb Fix #448: Support app-wide defaults for HTML helpers 2015-05-12 14:10:59 -07:00
Eilon Lipton ac230a78c1 Update Home master -> Home dev 2015-05-12 11:26:36 -07:00
Henk Mollema 8b1f8b9748 Added new ValidationSummary overloads to sample
Overview now shows every possible overload.

#1743
2015-05-12 20:20:34 +02:00
Ryan Nowak 4939181075 Fix #2528 - Revert formatter behavior for [Required]
This change removes the support in the DCS formatter to issue an error
message when [Required] is used on a value type.
2015-05-12 11:17:31 -07:00
Pranav K 13a3c0b931 Moving System.Security.Cryptography.Hashing.Algorithms to dnxcore50 node
to unbreak failing MusicStore dnu deploy.
2015-05-12 11:15:26 -07:00
Ryan Nowak 39fe063aee Fix #2330 - Reimagine *FormatterContext
This change simplifies InputFormatterContext/OutputFormatterContext by
swapping ActionContext for HttpContext.

This change is important especially for InputFormatterContext as it
decouples ModelState from ActionContext - allowing us to fix a
related bug where the _wrong_ ModelState can be passed in for a
TryUpdateModel operation.
2015-05-12 11:05:56 -07:00
Doug Bunting fcf7b15c64 Remove `FromBodyOnProperty_RequiredOnValueTypeSubProperty_AddsModelStateError`
- this integration test depends on the old `[Required]` special case
- #2388 explicitly removes that bahaviour so the test goes with it
2015-05-11 17:18:52 -07:00
James Newton-King de630754bf SerializerSettings refactor
Add SerializerSettings to MvcOptions and pass those options to the JsonInputFormatter and JsonOutputFormatter.
Remove custom contract resolver.

PR feedback
Pass JsonSerializerSettings to JsonPatchInputFormatter

PR feedback
Make DI JsonOutputFormatter formatter use MvcOptions SerializerSettings

Fix JsonPatchInputFormatter using null ContractResolver

Fix tests
2015-05-11 16:43:17 -07:00
Doug Bunting 3fbead0ce8 Get builds working better within VS (temporary fix?); disable pre-compilation
- remove `RazorPreCompilation.cs` files from all but the PrecompilationWebSite
- related to #2498 but not addressing that issue since pre-compilation is what that site is about
2015-05-11 16:14:04 -07:00
James Newton-King ab4cd5c4c4 Add JsonHelper for serializing JSON in views
- remove NotNull from JsonHelper Serialize
2015-05-11 16:01:08 -07:00
Kiran Challa 40794fcc33 Custom stream writer which avoids writing the BOM and does not flush or close the stream. 2015-05-11 13:27:05 -07:00
Ajay Bhargav Baaskaran d6012d4297 [Fixes #2506] Added overload to Controller.Json to accept JsonSerializerSettings 2015-05-11 12:36:45 -07:00
Pranav K 131096ff61 Adding relevant unit tests for MvcRazorCodeParser property name trimming 2015-05-11 12:20:49 -07:00
David Paquette ab4d2eec31 ImageTagHelper
An ImageTagHelper that supports cache busting by appending a file
version hash to the image src attribute
[Resolves #2249]

Code cleanup
2015-05-11 13:41:10 -05:00
Pranav K a591e53dc9 Removing unused TypeHelper method 2015-05-11 06:15:35 -07:00
Matthew Bonner 648f00c03d MINOR: Removed additional space from indentation of ReferenceAssemblies HashSet. 2015-05-09 22:00:46 +01:00
Pranav K 320507604a Removing superfluous types and methods from Common. 2015-05-09 08:04:28 -07:00
Doug Bunting 61b76fd99f Use `ClosedGenericMatcher.ExtractGenericInterface()` from Common repo
- added in aspnet/Common@aae8e6e

nits:
- reorder dependencies alphabetically
- avoid `GetGenericArguments()` extension method with `ExtractGenericInterface()` return value
 - use `GenericTypeArguments`
- usual trailing whitespace auto-removals
2015-05-08 20:23:06 -07:00
Harsh Gupta 583277cceb Adding tests for ActionParameters and TryUpdateModel 2015-05-08 19:11:03 -07:00
Ryan Nowak 8a476b56d8 Part 2 of fix for #2248 - Support 'override' of attribute routes on action
methods

This change applies the 'override' semantic to attribute routes on virtual
methods.

A method override can either inherit attribute routes from a base
definition, or can replace them. It's not possible to inherit routes and
also add to them.
2015-05-08 17:05:50 -07:00
Ryan Nowak 46db71cfce Part 1 of fix for #2248 - Ambiguity when inheriting attribute routes
The change here is to make an attribute route defined on a base class
inherited only if no other routes were defined 'closer' to the controller
class.

To put another way, attribute routes can either be inherited or
overridden, you can't inherit + add your own.
2015-05-08 17:05:45 -07:00
Ryan Nowak 2b4702728d Fix #1910 - Review and improve docs for 'Order' properties 2015-05-08 14:31:32 -07:00
Ryan Nowak 0f6b2331ce Fix #2378 - Fully expand models in ApiExplorer
This change dramatically simplifies the parameter discovery logic in
DefaultApiDescriptionProvider. Instead of surfacing POCO objects as
parameters, we now fully expand every model.

The rationale is that we want to show every key/value that can be set by
the user and not force consumers of ApiDescription to do that themselves.

Tests are cleaned up to match the new behavior.
2015-05-08 11:53:38 -07:00
Chris R bd03142dab React to Http namespace changes. 2015-05-07 15:19:10 -07:00