Commit Graph

4039 Commits

Author SHA1 Message Date
Pranav K 60a9810268 Allow PartialTagHelper to specify a null model. Fixes #7667 2018-04-18 14:16:44 -07:00
Kiran Challa faca3da42f Ensure ViewData is set on PageResult after a handler method executes
[Fixes #7665] Initializing PageResult.Page as part of result execution breaks Identity UI
2018-04-18 11:44:04 -07:00
Kiran Challa 4f7d53f4e7 [Fixes #7658] FileStreamResultExecutor fails to Dispose FileStream 2018-04-18 11:43:09 -07:00
Kiran Challa 6e4bd1eb46 Fixed PageFilter docs 2018-04-18 11:42:40 -07:00
Javier Calvarro Nelson 1cede88f26 [Fixes #7656] Deps file for netstandard2.0 targeting projects copied by Microsoft.AspNetCore.Mvc.Testing does not play well with Mvc 2018-04-18 11:03:52 -07:00
Javier Calvarro Nelson e781cd38cf [Fixes #7635] Provide a way to configure HTTP Client instances 2018-04-17 12:52:56 -07:00
Javier Calvarro Nelson e0b4c13895 [Fixes #7587] Default to Development environment in tests 2018-04-17 12:52:51 -07:00
Doug Bunting e0e96ce53b
Include parameter type's attributes in ModelMetadata
- #7595
- #7595 relates to #7350 but does not have the same root cause
  - did _not_ revert the src changes in #7350 fix (d995b0418a)
- make non-`[Obsolete]` `ModelAttributes` constructor overload `internal`
  - should generally use `static` methods and not any constructor
  - change some unit tests to use `[Obsolete]` constructor overloads (with suppressions)
- fix test `ParameterBinderExtensions` to use current `ParameterBinder.BindModelAsync(...)` overload
  - found some tests updated `IModelMetadataProvider`, `MvcOptions`, etc. instances but didn't register them in DI
- extend `ModelBindingTestHelper` and `ModelBindingTestContext`
  - reorder some tests to use correct `MvcOptions` and `IModelMetadataProvider` everywhere
  - fixes above issues

nits:
- take a few VS suggestions
- remove an old comment indended only for PR "Reviewers:"
2018-04-17 12:40:38 -07:00
Ryan Brandenburg 864a4e39c3 Branching for 2.1.0-rc1 2018-04-16 17:00:28 -07:00
Pranav K d8fc2d4009 Fix test failures
* Disable deps file generation in class library project. This workarounds known issue - https://github.com/dotnet/core-setup/issues/3726
* Update RazorProjectRouteModelProvider to not specify a trailing slash. This produces paths with a single slash as opposed to two slashes messing with route creation.
* React to Microsoft.AspNetCore.Mvc.Razor.Extensions.Reference that shows up in the deps file.
2018-04-15 16:31:41 -07:00
ASP.NET CI 128c7e0a17 Update dependencies.props
[auto-updated: dependencies]
2018-04-15 14:19:34 -07:00
Doug Bunting cc5ae02b7d
Fix binding & validating dictionaries of non-simple types in jQuery requests
- #7423
- retry failed inner bindings with alternate syntax in `ModelStateDictionary`
  - use property syntax if first attempt tried index syntax and visa versa
- instantiate `ShortFormDictionaryValidationStrategy` with full `ModelState` keys
  - can now provide exact `ModelState` keys that `ModelStateDictionary` used in inner bindings
- normalize model names without a leading period in `JQueryKeyValuePairNormalizer`

nits:
- take a few VS suggestions
2018-04-14 10:41:00 -07:00
Kiran Challa e52933e4e3 Removed UrlTestEncoder references in tests
This is because with the following commit, Routing no longer depends on DI to get a UrlEncoder and always uses UrlEncoder.Default.
4184b2406d
2018-04-14 06:08:20 -07:00
Javier Calvarro Nelson 4984dd2cdd Revert "[Fixes #7587] No easy way to change ASPNETCORE_ENVIRONMENT"
This reverts commit 22510e1377.
2018-04-13 16:51:25 -07:00
Javier Calvarro Nelson 86a036cf76 Revert "[Fixes #7635] Provide a way to configure clients in WebApplicationFactory"
This reverts commit 1e26571ba6.
2018-04-13 16:50:38 -07:00
Javier Calvarro Nelson 1e26571ba6 [Fixes #7635] Provide a way to configure clients in WebApplicationFactory 2018-04-13 16:02:56 -07:00
Javier Calvarro Nelson 22510e1377 [Fixes #7587] No easy way to change ASPNETCORE_ENVIRONMENT 2018-04-13 16:02:56 -07:00
Kiran Challa d5e044f693 [Fixes #7373] Assigning to the context's Result property, when implementing IPageFilter, causes an exception 2018-04-13 15:11:44 -07:00
Ajay Bhargav Baaskaran bfbd286ab6 Remove usages of obsolete APIs 2018-04-13 14:54:35 -07:00
Pranav K d995b0418a Allow BindPropertyAttribute to be specified on controller classes
Fixes #7350
2018-04-13 13:58:44 -07:00
John Luo c35030267c Update usage of TestSink 2018-04-13 10:21:41 -07:00
Nate McMaster e6be423c33
Remove netcoreapp2.0 from MvcSandbox 2018-04-13 09:42:05 -07:00
Martin Costello 2e761415e4 Implement IDisposable for derived types for WebApplicationFactory<T> (#7637)
* Implement IDisposable for derived types for WebApplicationFactory<T>

Add a protected Dispose method and a finalizer to WebApplicationFactory<T> for use in classes that derive from it and want to dispose of their own resources.
Resolves #7631.

* Address review feedback

Only dispose of fields if disposing is true.
2018-04-13 09:30:33 -07:00
Pranav K e34b4e8335
Use DependencyContext.CompileLibraries to determine dependency graph (#7626)
* Use DependencyContext.CompileLibraries to determine dependency graph

Fixes https://github.com/aspnet/Mvc/issues/7617
2018-04-11 15:57:11 -07:00
Pranav K 9cea47fa7d Remove root directory customization options for Razor Pages areas
Fixes #7608
2018-04-11 15:25:31 -07:00
Kiran Challa 62272ad56a Round off file result's LastModifiedDate to whole seconds for correct comparison with http header dates
[Fixes #7572] PhysicalFileResult does not respond 304 Not Modified
2018-04-11 06:43:50 -07:00
Pranav K 3db924003e Use VirtualRazorProjectSystem for Razor tests 2018-04-09 15:27:03 -07:00
flash2048 39053a5e22 Corrects spelling of some comments 2018-04-09 14:37:20 -07:00
Pranav K ec31ff0c28
Throw if multiple Body bound parameters are discovered
Fixes #6963
2018-04-09 11:20:34 -07:00
Pranav K feed0fea2c
Merge branch 'release/2.1' into dev 2018-04-06 11:01:32 -07:00
Pranav K 5e019bd707
Add Microsoft.AspNetCore.All
Fixes https://github.com/aspnet/Mvc/issues/7605
2018-04-06 10:57:59 -07:00
ASP.NET CI 8e323a8e1e Update dependencies.props
[auto-updated: dependencies]
2018-04-03 22:35:30 +00:00
Pranav K e91e8b8ce2
Merge branch 'release/2.1' into dev 2018-04-02 10:34:16 -07:00
Pranav K 07a1907918
Introduce ViewDataAttribute
Allow properties on controllers, Razor Page and Razor Page models annotatted with [ViewDataAttribute]
to populate ViewDataDictionary

Fixes https://github.com/aspnet/Mvc/issues/6525
2018-04-02 10:31:16 -07:00
Pranav K fdc4df35ed
Fix build break 2018-04-02 10:29:46 -07:00
Pranav K c7559e1ff4
Merge pull request #7590 from aspnet/release/2.1
Release/2.1
2018-04-02 09:49:14 -07:00
Pranav K c515cece8e Use ModelMetadataProvider to infer BindingSource on application model 2018-04-02 09:48:49 -07:00
Kristian Hellang a16504b941 Added failing test for #7546 2018-04-02 09:48:49 -07:00
N. Taylor Mullen ebd328853c Merge branch 'release/2.1' into dev 2018-03-30 17:12:35 -07:00
N. Taylor Mullen 7d1576a65d Fix MVC being able to build in VisualStudio. 2018-03-30 17:12:10 -07:00
Pranav K aebea720ed
Merge pull request #7582 from aspnet/release/2.1
Target a lower TFM
2018-03-30 14:46:07 -07:00
Pranav K 30f0883319 Target a lower TFM 2018-03-30 14:45:42 -07:00
Pranav K 35bf14e972
Merge pull request #7581 from aspnet/release/2.1
Make Microsoft.AspNetCore.Mvc depend on Microsoft.AspNetCore.Mvc.Anal…
2018-03-30 14:20:51 -07:00
Pranav K 133dd964ab Introduce ViewDataAttribute
Allow properties on controllers, Razor Page and Razor Page models annotatted with [ViewDataAttribute]
to populate ViewDataDictionary

Fixes https://github.com/aspnet/Mvc/issues/6525
2018-03-30 14:19:52 -07:00
Pranav K 61f260e386 Make Microsoft.AspNetCore.Mvc depend on Microsoft.AspNetCore.Mvc.Analyzers 2018-03-30 12:34:08 -07:00
Pranav K 6f03496448 Make Microsoft.AspNetCore.Mvc depend on Microsoft.AspNetCore.Mvc.Analyzers 2018-03-30 12:33:45 -07:00
Pranav K 577c2745d5
Merge remote-tracking branch 'origin/release/2.1' into dev 2018-03-29 21:51:45 -07:00
Ryan Nowak f20bf9ea02 Fix #7503 change to model name for IValidableObject
This change undoes a breaking change introduced by the 2.1 model
validation changes. Now an implementation of IValidableObject on a
top-level model will be called correctly with the 'empty' prefix instead
of the parameter name.

When fixing this we undid a workaround for another issue.

When validating a parameter that didn't bind we didn't correctly compute
the model name for 'fallback to empty prefix' cases.

(cherry picked from commit 7a1096a72b)
2018-03-29 21:35:59 -07:00
Ryan Nowak 7a1096a72b Fix #7503 change to model name for IValidableObject
This change undoes a breaking change introduced by the 2.1 model
validation changes. Now an implementation of IValidableObject on a
top-level model will be called correctly with the 'empty' prefix instead
of the parameter name.

When fixing this we undid a workaround for another issue.

When validating a parameter that didn't bind we didn't correctly compute
the model name for 'fallback to empty prefix' cases.
2018-03-29 21:35:03 -07:00
Ryan Nowak 96f29c5696 Use latest compat version in MvcSandbox 2018-03-29 21:35:03 -07:00