Commit Graph

2209 Commits

Author SHA1 Message Date
Ajay Bhargav Baaskaran d40e6612a4 Moving the order of generated hidden tags for checkbox to end of the form
- #2994
- Affects both HtmlHelper and TagHelper scenarios
- Checkboxes not enclosed in a form will generate inline hidden tags
- Added necessary properties to FormContext
- Added some functional and unit tests
2015-10-14 15:43:13 -07:00
Doug Bunting 03625c38af Correct polarity of MediaTypeHeaderValue.IsSubsetOf()` checks and remove one conneg fallback
- aspnet/Mvc#3138 part 2/2
- request's Content-Type header must be a subset of what an `IInputFormatter` can consume
  - `[Consumes]` is similar
- what an `IOutputFormatter` produces must be a subset of the request's Accept header
  - `FormatFilter` and `ObjectResult` are similar
- `ObjectResult` no longer falls back to `Content-Type` header if no `Accept` value is acceptable
- left `WebApiCompatShim` code alone for consistency with down-level `System.Net.Http.Formatting`
- correct tests to match new behaviour
  - do not test `Accept` values containing a `charset` parameter; that case is not valid

WIP:
- four test failures; something about comparing media types w/ charset included
- why do some localization tests fail in VS?

nits:
- add `InputFormatterTests`
- add / update comments and doc comments
- correct xUnit attributes in `ActionResultTest`; odd it doesn't show up in command-line runs
2015-10-14 11:59:20 -07:00
Doug Bunting 2e2043f427 Test `[FromServices]` with service that is not available
- test `[FromServices]` for a defined type without a `BinderModelName`
- test `[FromServices]` for a service not available in DI
- test `[FromServices]` for `IEnumerable<TService>` properties

nit: correct name of `ServicesModelBinderTest` to match the model binder class
2015-10-14 11:46:11 -07:00
Doug Bunting 9aed5efd51 Add `null` checks for MVC tag helpers 2015-10-14 11:27:25 -07:00
Doug Bunting c3ac457c20 Fix local build break 2015-10-12 12:59:16 -07:00
Pranav K 0309a5216c Add an option to RazorPrecompileModule to allow conditional compilation
based on Configuration.

Fixes #3276
2015-10-12 11:59:55 -07:00
Chris R 6e347724b5 React to IHeaderDictionary changes. 2015-10-12 11:38:24 -07:00
Doug Bunting 5a1c120392 React to aspnet/Universe#290 fix 2015-10-12 10:42:45 -07:00
Doug Bunting 35d176f5b2 Update DNX Core on Linux workarounds
- remove skip conditions for aspnet/External#33, aspnet/External#41, aspnet/External#42, aspnet/External#43
- add workaround for aspnet/External#47; avoid "g" custom datetime format specifier
- make tag helper execution order determinate in `TagHelpersWebSite`

Will test DNX Core in Travis builds (use `--test-dnxcore`) once aspnet/Universe#290 fix is in.

nits:
- remove useless `using`s for `Microsoft.AspNet.Razor.TagHelpers`
2015-10-10 23:09:51 -07:00
Ryan Nowak 9342cb0ab7 Suppress [Obsolete] warnings from DiagnosticSource 2015-10-08 12:47:08 -07:00
Pranav K 91cb6281e4 Using @inherits and @model together gives intellisense errors
Fixes #3243
2015-10-08 11:02:20 -07:00
Pranav K 18912b9530 Removing NotNullAttribute.Sources references that were left behind 2015-10-06 17:36:46 -07:00
Pranav K 30f5826380 Use Type.GetMethod in ViewComponentMethodSelector
Fixes #3211
2015-10-06 16:21:56 -07:00
Ryan Nowak d9e40d92de Make ModelPropertyCollection inherit ReadOnlyCollection<T>
Just some small cleanup. Did a search and all of our other custom List-ish
things inherit either Collection<T> or ReadOnlyCollection<T>.

Still no good solution for dictionaries.
2015-10-06 14:43:02 -07:00
Ryan Nowak 0dadf56fc8 Reducing allocations in value providers
- Don't go async in formdata providers unless we need to
- Remove unnecessary defensive copy in CompositeValueProvider
2015-10-06 14:25:19 -07:00
Ryan Nowak 082f175b48 Optimize allocations in GetFilters
Doing it the old fashioned way to get rid of some allocations.
2015-10-06 13:41:44 -07:00
Ryan Nowak e54da5e6f6 Remove dead code in invoker (SetStage) 2015-10-06 13:28:33 -07:00
Ryan Nowak 761c7e6751 Optimize allocations for creating ActionConstraints 2015-10-06 12:35:13 -07:00
Ryan Nowak 1ed22e5939 Avoid state machine and allocation for 0-parameters 2015-10-06 12:02:49 -07:00
Pranav K 04d72d8894 Simplify FileResult
Fixes #3249
2015-10-06 11:26:56 -07:00
Ryan Nowak 04c6fceb94 React to aspnet/Routing#215 2015-10-06 10:37:56 -07:00
Pranav K a602d548e2 Allow ViewFeature tests to run in dnxcore50 2015-10-06 09:46:49 -07:00
Anthony van der Hoorn a0764faa86 Bring arguments inline between before/after events 2015-10-05 16:42:25 -07:00
Ryan Nowak 32c174c791 CR feedback from attribute dictionary 2015-10-05 10:38:46 -07:00
Ryan Nowak ad3c257ef5 Fix for #3252 - Issues with pooled buffer + unicode
- Dispose buffers when Flush throws inside the Dispose method
- Compute size of buffers correctly
- Throw earlier when handed invalid-sized buffers
2015-10-05 09:45:23 -07:00
Pranav K f57e180971 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:53 -07:00
Pranav K 8d7b95655d Removing Autofac dependency 2015-10-03 12:18:19 -07:00
Ryan Nowak 6185b16795 Custom dictionary type for attributes 2015-10-02 18:08:58 -07:00
Ryan Nowak 4e08eda58d Use pooled memory for the streamwriter 2015-10-02 14:35:15 -07:00
Ryan Nowak 306776ff63 Minor cleanup/refactor of ViewResult
- Make ViewExecutor a service
- Add facades for ViewResult/PartialViewResult
- Add eventing for ViewFound/NotFound in PartialViewResult
- Add eventing around view execution
- Cleanup of some various eventing & our tests code
2015-10-02 08:18:00 -07:00
Kiran Challa eef6c3883a Renamed PhysicalFileProviderResult and VirtualFileProviderResult to PhysicalFileResult and VirtualFileResult respectively 2015-10-01 19:57:35 -07:00
Kiran Challa 130d94eb7e [Fixes #3068] TempData fails silently without sessions middleware 2015-10-01 19:28:46 -07:00
N. Taylor Mullen 7b58e03f90 Update 'build.cmd' alias parameter to use full name. 2015-10-01 11:59:19 -07:00
Pranav K 2028351bb8 React to WriteAttribute \ AddHtmlAttribute API changes 2015-10-01 10:19:14 -07:00
Pranav K 5a705d820d Replacing NotNullAttribute with thrown exceptions 2015-10-01 08:23:21 -07:00
Pranav K 3a876e387f Replacing NotNullAttribute with thrown exceptions 2015-10-01 06:19:18 -07:00
Pranav K 02c36a1c48 Replace NotNullAttribute with thrown exceptions 2015-09-30 17:18:16 -07:00
Kirthi Krishnamraju fa5f9399e8 Remove mono check from localization test 2015-09-30 11:44:00 -07:00
Ajay Bhargav Baaskaran eefa58e617 [Fixes #3043] Overflow exceptions converted to invalid value messages 2015-09-29 16:24:19 -07:00
Gerardo Melendrez f162f70c1e Fixed typo (occured to occurred) in comments and resources. 2015-09-29 10:19:26 -07:00
Doug Bunting 13af6f8e1a Wrap rather long line in 9243d83 2015-09-29 09:58:23 -07:00
Stefán Jökull Sigurðarson c713aa92ca Making the HtmlHelper.GetEnumSelectList take DisplayAttribute.GroupName into account to create select groups. 2015-09-29 09:53:48 -07:00
Pranav K 9243d832de Merge branch 'release' into dev 2015-09-28 23:16:33 -07:00
Pranav K 5b80edcdff Updating to release NuGet.config. 2015-09-28 23:16:31 -07:00
Ryan Nowak d37f5aeb31 Fix #3217 - Optimize IList.GetEnumerator allocations
This change fixes call sites on the main request path for a simple site
(model binding, validation, views) that allocate boxed list enumerators.

Some cases aren't addressed by this change because the fix is too invasive
or requires changing an important contract to take IList instead of
IEnumerable. Will follow up on those case by case in order of importance.
2015-09-28 16:17:48 -07:00
Doug Bunting 28aec3f5cc Support user overrides of system-provided `ModelError` messages
- #2969
- add `ModelBindingMessages` for configuration and `IBindingMetadataProvider` overrides
  - use `interface` to avoid `new` oddities when adding a setter to an `abstract` property
- add `IModelBindingMessages` to `ModelMetadata` for use in rest of the product code
- plumb the various bits through the system
- add integration tests using a custom `IBindingMetadataProvider`s to override messages

nits:
- remove unused resources
- use `AttemptedValue` and not `model` in `SimpleTypeModelBinder`
2015-09-28 15:50:21 -07:00
Ryan Nowak 0d6edf240a Move ModelExplorer to ViewFeatures 2015-09-28 14:14:40 -07:00
Søren Kruse ec18b35123 Add FormatterCollection<T>
#2945
2015-09-28 13:23:19 -07:00
Ryan Nowak 67b43b4cfe Workaround Mono bugs to fix travis
This change works around two mono issues that are blocking travis. I'd
like to have tests skip instead, but unfortunately that would mean not
running any validation tests on mono so this seems better.

- RuntimeHelpers.GetHashCode will sometimes crash the runtime
- PropertyHelper sometimes returns throws null-ref
2015-09-28 12:58:45 -07:00
Pranav K 18c80d156c Replace NotNullAttribute with thrown exceptions 2015-09-26 23:48:43 -07:00