Commit Graph

68 Commits

Author SHA1 Message Date
Pranav K 2b50ec99df Updating to 4.4 CoreFx packages 2016-12-21 16:47:14 -08:00
Pranav K b82969a557 Updating versions to 1.2.0-* 2016-11-09 14:18:46 -08:00
jacalvar bfe50ddd8c Created public API baselines 2016-11-04 23:53:26 -07:00
Doug Bunting ada42ea913 Move value source information from `<remarks>` to `<summary>`
- #1999
- may have reordered the precedence comments as I double-checked the implementations
 - `CheckBox()` and `RadioButton()` were examples of such updates

nits:
- use SSL in documentation links
- simplify mentions of format strings
- remove a few phrases that didn't say much and duplicated `<remarks>`
2016-10-28 16:43:59 -07:00
Vladislav Karamfilov 3ef7d01bb6 Small code cleanup (#5388)
* Removed unused private GetUrlHelper method in LocalRedirectResult class.

* Minor code formatting improvements.

* Fixed white space and casing of 'URL' in comment in RedirectResultExecutor.
2016-10-17 20:45:47 -07:00
Ryan Brandenburg 69b4b64fd5 Cache ModelMetadata HashCode 2016-10-17 12:06:14 -07:00
Ben Adams a80d7d744a Speed up MSD.GetNode 2016-10-17 10:48:36 -07:00
Pranav K 6d235e4ef5 Update partner package versions 2016-10-03 14:27:20 -07:00
Doug Bunting 4cca6b09f0 Reduce allocations during HTML generation
- #3918
- precompute size of `StringBuilder` in `ExpressionHelper`
- reduce `string` allocations in `ViewDataEvaluator`
 - also get rid of `Enumeration` state machines
- reduce the size of a few objects; use more expression-valued properties
 - e.g. don't store `_modelType` in `ModelExplorer`
- add `EmptyArray<TElement>`; make empty arrays consistently `static`
- avoid `string.Split()` in HTML and tag helpers

nits:
- make `ExpressionHelperTest` tests more stringent
- correct `Message` for an `ArgumentNullException`
- remove excess `using`s in classes I touched (but often ended up leaving otherwise unchanged)
- improve doc comments
- remove `ToString()` call on a `string`
- avoid encoding `string.Empty`
- fix test file name
- remove useless variables
- correct spelling
- improve whitespace
2016-10-03 12:17:47 -07:00
Kristian Hellang 8fb339483d Move HttpContext property up a level 2016-10-03 08:34:23 -07:00
Ryan Brandenburg 830983a477 Fixes #5198 Stops caching of Enum display values (#5185)
Fixes #5197 GetEnumSelectList uses IStringLocalizer
Fixes #4215 Html.DisplayFor now checks DisplayAttributes on enums
2016-09-07 16:00:17 -07:00
Doug Bunting fae0e9a66e Handle `!ConvertEmptyStringToNull` cases correctly in `SimpleTypeModelBinder`
- #4988
- preserve whitespace as the setting demands
 - correct previous `string.IsNullOrEmpty()` call to match previous `ValueProviderResultExtensions.ConvertTo()` use
- short-circuit other `string`-to-`string` conversions (as `ValueProviderResultExtensions.ConvertTo()` does)
- correct documentation of `ConvertEmptyStringToNull` properties
- add more tests of these scenarios and remove duplicate `BindModel_ValidValueProviderResult_ConvertEmptyStringsToNull()` test
2016-09-02 16:15:18 -07:00
Ajay Bhargav Baaskaran 499fefcc03 Added some missing docs 2016-08-26 16:35:44 -07:00
Doug Bunting 7430efa8cc One build to rule them all
- well, at least VS and command-line builds will share output
- part of aspnet/Coherence-Signed#277
2016-07-06 16:21:18 -07:00
Ryan Nowak 3ed0d01eae Fix #4929 - Move IActionInvokerFactory from .Internal
Also added a wealth of doc comments to an area that's not currently super
well documented.
2016-07-05 13:18:34 -07:00
Doug Bunting 15f25d569a Improve `IUrlHelper` and related doc comments
- #4245, #4507
2016-07-05 09:34:33 -07:00
Pranav K cd7954a164 Updating to dev versions 2016-06-16 10:40:11 -07:00
Ryan Brandenburg 5339a3e0ce Add ExceptionHandled to ExceptionContext (#4825) 2016-06-09 15:22:11 -07:00
Ryan Nowak a8142b8858 Fix #4614 - update IModelBinder docs 2016-06-09 14:21:07 -07:00
Derek Gray 5a3875ea72 Alter content negotiation algorithm so that it can be configured (via
MvcOptions) to always respect an explicit Accept header. Fixes #4612.
2016-06-07 16:12:36 -05:00
Ryan Nowak 2e2784aa3d [Design] Split up MvcRouteHandler
This change splits up the conventional routing path from the attribute
routing path *inside* routing, instead of inside `MvcRouteHandler`. Each
attribute route group now gets its own instance of
`MvcAttributeRouteHandler` which just knows about the actions it can
reach.

This removes the concept of a route-group-token and removes the lookup
table entirely for attribute routing. This also means that the
`DefaultHandler` on `IRouteBuilder` will not be used for attribute routes,
which we are OK with for 1.0.0.

The action selector's functionality is now split into two methods. We
think this is OK for 1.0.0 because any customization of `IActionSelector`
up to now had to implement virtually the same policy as ours in order to
work with attribute routing. It should now be possible to customize the
selector in a meaningful way without interfering with attribute routing.
2016-06-07 08:12:47 -07:00
Derek Gray 5f36adbee3 Fix filename for ModelValidatorProviderContext (fixes #4798) 2016-06-02 14:34:33 -05:00
jacalvar 6a6d2e0d9f [Fixes #4506] Move and rename ActionDescriptor.Name to ControllerActionDescriptor.ActionName 2016-05-31 23:13:20 -07:00
Doug Bunting e63f094a5f Use type metadata for `ModelBinderProviderContext.BindingInfo`
- #4652
- previously ignored for top-level models
- `ModelBinderProviderContext.BindingInfo` is now never `null`
- similarly, use type metadata (as well as parameter info) for `ModelBindingContext.BinderModelName`
 - previously ignored when overridden in `ControllerArgumentBinder`
2016-05-27 23:00:29 -07:00
John Luo 5eed7b9b88 React to updated CoreCLR packages
https://github.com/aspnet/Coherence/issues/97
2016-05-26 18:31:05 -07:00
Michiel Post b6794ab1b7 Fixed null reference on ModelStateDictionary.ChildNodes when calling Clear 2016-05-26 16:12:49 -07:00
Ryan Nowak d92b3ba2c6 Make ModelBindingContext.Result non-nullable
This change simplifies a bunch of code and fits more in line with the
current design of model binding.

Now, a model binder only has to do anything if it was successful.
'return' is enough to indicate failure.
2016-05-23 14:18:34 -07:00
Ryan Nowak 88c9ae6588 Remove Key from ModelBindingResult 2016-05-23 13:17:19 -07:00
Kiran Challa 20a2e748ec Added ValueProviderFactories to ResourceFilterExecutingContext
This enables removing value provider factories from model binding(which is needed in some scenarios like large file uploads)
2016-05-20 04:15:07 -07:00
Pranav K 78be3ad135 Revert "Update Minor versions (#4657)"
This reverts commit e731a327cf.
2016-05-18 09:11:20 -07:00
Ryan Brandenburg e731a327cf Update Minor versions (#4657) 2016-05-17 12:40:20 -07:00
David Obando 742a9e3f3b Reduce the number of allocations during model validation
When the service receives a model (say, via a POST message) MVC validates it to ensure the model is in a correct state. Validation currently incurs in many allocations that can be avoided. This tackles two of them:
  1. We're now caching the generic `GetEnumerator<T>` method infos generated on the fly during collection validation, and
  2. We're now only initializing `ModelErrorCollection` on demand.

The first one incurs in the additional allocation of 1 long-lived dictionary object, which will grow only to the amount of `Collection<T>` types used by the model being validated. This is expected to be a small to medium number.

The second change assumes that class `ModelStateEntry` isn't thread safe, as model validation isn't multithreaded.

This resolves #4434 and #4435.
2016-05-02 19:28:20 -07:00
Pranav K 3d494fd732 Merge branch 'release' into dev 2016-05-02 14:58:54 -07:00
Pranav K 36146a6139 Fix build warnings 2016-05-02 14:52:02 -07:00
Ryan Nowak 756cd2dab8 Remove OperationBindingContext
This change trims a few concepts that aren't really needed inside
ModelBinders anymore, and removes the OperationBindingContext class.
2016-04-25 09:29:03 -07:00
Ryan Nowak af58c2e6b6 Streamlining action selection and route values
Removes a few concepts we don't need
Improves documentation
More things are IDictionary instead of other random types
2016-04-22 17:36:23 -07:00
Doug Bunting eda647e270 Complete the doc comments for filters
- #3851
- add lots of words
- correct that vs. which confusion
2016-04-13 16:01:30 -07:00
Eilon Lipton 4f24339740 Fix package metadata 2016-04-13 12:07:04 -07:00
Ryan Nowak 3ec60a0181 Fix #4447 - Teach MVC to understand defaults
The wireup for defaults in attribute routes was missing
2016-04-11 14:38:29 -07:00
Pranav K 2bf79a874d Removing imports from src projects 2016-04-08 06:49:31 -07:00
Ryan Nowak 144766f2e3 Simplify BindAttribute - rename PredicateProvider
This change renames IPropertyBindingPredicateProvider to
IPropertyFilterProvider. The changes here are mostly renames of
parameters/variables from predicate -> propertyFilter. I did a
find+replace and left the term 'predicate' in some of the docs because it
refers to a predicate in the abstract sense.

This change also simplifies BindAttribute and removes support for type
activation.
2016-03-31 12:34:02 -07:00
Ryan Nowak fb81a5e11e Introducing ModelBinderFactory
This change separates model binding into IModelBinderProvider (decides
which binder to use) and IModelBinder (does binding). The
IModelBinderFactory is a new services with coordinates the creation of
model binders.
2016-03-29 15:45:14 -07:00
Ajay Bhargav Baaskaran 8e6b4980e3 [Fixes #4310] Moved AuthorizeFilter and CorsAuthorizationFilter to a public namespace 2016-03-21 11:54:03 -07:00
Pranav K f651f18d3a Use a prefix tree as a backing store for ModelStateDictionary 2016-03-17 10:09:36 -07:00
Ryan Nowak fec1268bf3 Remove ModelBinding features from ResourceFilters
Removes all of the ModelBinding configuration support from Resource
Filters. We haven't come up with concrete scenarios around these features,
and don't want to paint ourselves into a corner with extensibility.
2016-03-16 16:33:14 -07:00
Ajay Bhargav Baaskaran ca164db921 [Fixes #4214] Moved IUrlHelper to Mvc.Abstractions 2016-03-04 16:45:47 -08:00
Ajay Bhargav Baaskaran e2fd41e416 Added Company, Copyright and Product attributes to AssemblyInfo 2016-03-03 17:33:48 -08:00
Doug Bunting b35922e373 Remove project name from output path
- aspnet/Coherence-Signed#187
- remove `<RootNamespace>` settings but maintain other unique aspects e.g. `<DnxInvisibleContent ... />`
- in a few cases, standardize on VS version `14.0` and not something more specific
2016-03-02 14:39:12 -08:00
N. Taylor Mullen 33d1aea8ea Transition to Netstandard.
- dotnet5.X => netstandard1.y (where y = x-1).
- DNXCore50 => netstandardapp1.5.
- Applied the same changes to ifdefs.
2016-03-01 13:39:31 -08:00
Doug Bunting f889965929 Simplify `IsAssignableFrom()` use
- standardize on the `Type` extension method; less verbiage
- `ModelMetadata` had a redundant `IsAssignableFrom()` call
- `ModelBindingHelper.ValidateBindingContext()` over-engineered and used just once
 - do useful bit inline in `KeyValuePairModelBinder` but now a silent "does not apply" case
2016-02-26 21:30:00 -08:00