Commit Graph

159 Commits

Author SHA1 Message Date
Pranav K 8d66f104f7 Make types in Microsoft.AspNetCore.Mvc.Internal namespace internal 2018-11-08 14:00:16 -08:00
Doug Bunting c74a945dda
Convert `RouteValueDictionary` values to `string` using `CultureInfo.InvariantCulture` (#8674)
* Convert `RouteValueDictionary` values to `string` using `CultureInfo.InvariantCulture`
- #8578
- user may override this choice in one case:
  - register a custom `IValueProviderFactory` to pass another `CultureInfo` into the `RouteValueProvider`
- values are used as programmatic tokens outside `RouteValueProvider`

nits:
- take VS suggestions in changed classes
- take VS suggestions in files I had open :)
2018-10-30 20:09:17 -07:00
Pranav K 8a183bb4f4 Allow serving Razor files with leading underscore
Fixes https://github.com/aspnet/Mvc/issues/8617
2018-10-19 13:43:35 -07:00
Doug Bunting 5bddd226a3
Use Internal.AspNetCore.Sdk as an MSBuild SDK
- should resolve issues with occasional strange MSBuild caching issues in this repo
- modeled after aspnet/Scaffolding#905
- follows aspnet/BuildTools#729 recommendation to check in global.config file
  - see also Microsoft/msbuild#2914
- use newer KoreBuild
  - `.\build.cmd -update /t:noop`
2018-10-04 15:12:38 -07:00
Pranav K 153165f9ad
Handle OPTIONS requests without a handler in Razor Pages (#8528)
* Handle OPTIONS requests without a handler in Razor Pages

Fixes #7438
2018-10-04 12:25:36 -07:00
James Newton-King 94101a9cde
Add PageRouteTransformerConvention (#8541) 2018-10-04 17:34:26 +13:00
Simon Cropp 43d4416a1d Fix typos (#8413) 2018-09-12 09:34:45 -07:00
James Newton-King 863b1c2c97
Action endpoint metadata contains attributes from action and controller (#8395) 2018-09-07 10:01:40 +12:00
Pranav K 07cc9e66c6
Add a feature to disable file watching in Razor pages (#8369)
* Add a feature to disable file watching in Razor pages

Fixes https://github.com/aspnet/Mvc/issues/8362
2018-09-06 10:16:31 -07:00
Simon Cropp b156dee4f1 Fix some spelling (#8378) 2018-09-06 07:39:01 -07:00
Pranav K 522006d2c8
[Design] Add a MaxValidationDepth option to ValidationVisitor
Fixes #7357
2018-08-16 15:01:18 -07:00
Pranav K a375cba359
Copy action constraints and EndPointMetadata when setting up a PageActionDescriptor (#8208)
* Copy action constraints and EndPointMetadata when setting up a PageActionDescriptor

Fixes #8207
2018-08-03 12:04:44 -07:00
hishamco dee479fda7
Add partial helper to Razor Page \ PageModel
Fixes #7885
2018-07-09 11:01:15 -07:00
Pranav K 287a3c5e69 Allow IgnoreAntiForgeryToken applied on Razor Page models to work
Fixes #7795
2018-06-13 11:59:47 -07:00
Pranav K 632425d0e6 Unskip skipped tests 2018-05-29 12:10:59 -07:00
Nisha Kaushik 077b1d87a9 #7024 Request: ServiceBasedPageModelActivatorProvider [Review Changes] 2018-05-22 10:23:08 -07:00
Nisha Kaushik b8e5036e20 #7024 Request: ServiceBasedPageModelActivatorProvider 2018-05-22 10:23:08 -07:00
Nisha Kaushik 0c795c4f33 #7024 Request: ServiceBasedPageModelActivatorProvider 2018-05-22 10:23:08 -07:00
Pranav K e1eaf6a6e0
Cleanup TestCommon 2018-05-18 10:45:57 -07:00
Pranav K 26454fb1da Add ViewComponentResult helper methods to Page \ PageModel
Fixes #7051
2018-05-07 16:35:29 -07:00
Pranav K 5d5222cdd8 Introduce BindPropertiesAttribute
* Allow controller and Razor Page models to be annotated with BindPropertiesAttribute
* Disallow BindPropertyAttribute from being declared on types.
* Do not allow arbitrary binding attributes to be applied to Razor Page models.

Fixes #7686
2018-04-20 14:32:14 -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 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 9cea47fa7d Remove root directory customization options for Razor Pages areas
Fixes #7608
2018-04-11 15:25:31 -07:00
Pranav K 3db924003e Use VirtualRazorProjectSystem for Razor tests 2018-04-09 15:27:03 -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
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 f8e315d03d
CompiledPageRouteModelProvider should de-dup descriptors
Fixes #7543
2018-03-28 11:24:49 -07:00
Ryan Nowak c93c168df3 Add mapping service for action results
This allows the use of custom 'envelope' types like ActionResult<> with
a corresponding API Explorer implementation.

Basically this PR services to decouple a bunch of infrastructure from
ActionResult<>.
2018-03-27 17:13:41 -07:00
Pranav K 927af3125e
Use RazorCompiledItemMetadataAttribute to calculate route 2018-03-27 12:24:37 -07:00
Doug Bunting 5e245da326
Add compatibility switch controlling parameter metadata and top-level validation
- #7413 part 1 of 2
- made all `ModelMetadataProvider` and `ObjectModelValidator`-specific code conditional
  - fortunately, `MvcOptions` easy to get; affected code is primarily `internal` or pub-`Internal`
  - remove unnecessary `ModelMetadataProvider` use in `ApiBehaviorApplicationModelProvider`
- run integration and functional tests with `CompatibilityVersion.Version_2_1`
  - functional test change depends on @javiercn's recent #7541 fix
  - remove test code now redundantly turning compatibility switches on

nits:
- correct spelling errors in `CompatibilitySwitch`
- take VS suggestions, mostly in test code
- rename methods in `ControllerBinderDelegateProviderTest` to match current API
- slightly refactor in `ApiBehaviorApplicationModelProvider`
2018-03-26 12:29:04 -07:00
Ryan Nowak 14429721d9 Make handler selector more flexible
Some details of this pending discussion, but this is a new 2.1 change
and compatibility switch in the spirit of making pages handler selection
less error-prone.

In particular we don't want anyone to have to define HEAD to do the
trivial thing. This currently routes all 'safe' HTTP methods to the GET
handler and all other HTTP methods to the POST handler.

This is technically not the correct thing to do for OPTIONS and TRACE,
so we might still do something different.

The tests will change a little depending on exactly what we decide to
do, but this is the main idea of the change.
2018-03-23 14:22:48 -07:00
Pranav K ccb6793126
Introduce LifecycleProperty
Update TempDataAttribute infrastructure to use LifecycleProperty
2018-03-22 10:18:36 -07:00
Kiran Challa e2b6975bff Marked PageArgumentBinder type as Obsolete 2018-03-19 11:50:20 -07:00
Kiran Challa a0b1b15101 [Fixes #7412] AspNetCore 2.1 breaks integration with 3rd party validation libraries 2018-03-13 02:07:56 -07:00
N. Taylor Mullen 43106f688a Re-enable "Move to RazorProjectEngine."
- This was initially reverted due to insufficient packages for local builds.

This reverts commit 5ac6fa77f8.
2018-02-16 16:13:54 -08:00
N. Taylor Mullen 5ac6fa77f8 Revert "Move to RazorProjectEngine."
- Waiting for packages to be available from Razor.

This reverts commit 608330dc86.
2018-02-15 17:01:07 -08:00
N. Taylor Mullen 608330dc86 Move to RazorProjectEngine.
- Updated our consumption of `RazorEngine` and `RazorTemplateEngine` to use `RazorProjectEngine` and its features.
- Updated service registrations to maintain existing services but to also register new ones.
- When moving `RazorViewEngine` to use `RazorProjectFileSystem` I had to add an unused constructor item in order to disambiguate the constructors.
- Updated tests to use `RazorProjectEngine` and `RazorProjectFileSystem`.

#7377
2018-02-15 16:34:26 -08:00
Pranav K 06e40252a0 Add support for top level validation to Razor Pages 2018-02-14 14:39:25 -08:00
Pranav K dbff416be6 Add support for running conventions on controller properties, Razor Page parameter and properties
Fixes #6935
2018-01-29 11:43:25 -08:00
Javier Calvarro Nelson 7127bb5dbb Add DeclaredModelType to Razor pages
* This allows razor pages to override their model type with a model that
  extends the declared model type through the page application model.
2018-01-25 16:00:54 -08:00
Pranav K f0ae0ce528 Add PageConvention overloads for areas
Fixes #7246
2018-01-18 08:21:21 -08:00
Pranav K 946b64143e Allow override routes on Pages
Fixes #6605
2018-01-12 15:57:13 -08:00
Pranav K 094b61dfc6 Refactor PageRouteModel generation 2018-01-12 15:44:23 -08:00
Kiran Challa c922b0b90d Improving logging - model binding
Related to issue #6498: When enabling "Trace" logging for MVC loggers, I should be buried in log messages
2018-01-11 14:51:53 -08:00
Ajay Bhargav Baaskaran b20e35e76a Set RelativePhysicalPath in FileProviderRazorProjectItem 2018-01-11 13:20:17 -08:00
Doug Bunting afc75a8296 Move `IHttpRequestStreamReaderFactory` from `.Internal` to `.Infrastructure`
- #7044
- move `IHttpResponseStreamWriterFactory` too
- add breaking change records e.g. for changes to `BodyModelBinder[Provider]` constructors
  - these changes relate to previously-"internal" constructors and one property

nits: take VS suggestions for changed files
2018-01-09 10:51:09 -08:00
Ryan Nowak d58d0f917f Add support for recompilation 2018-01-08 15:26:20 -08:00