Commit Graph

1454 Commits

Author SHA1 Message Date
Pranav K 79d517483b Removing PageInstrumentation
Fixes #3497
2015-11-25 08:41:21 -08:00
Pavel Krymets 5ef14e95b7 React to dnx confguration change 2015-11-24 11:54:10 -08:00
apxoht 1c34d88f4c Removed unnecessary dependency of IActionSelector in UrlHelper 2015-11-23 15:44:55 -08:00
ryanbrandenburg b6f8c523a8 * Remove MvcSample and replace with MvcSandbox 2015-11-23 11:53:48 -08:00
ryanbrandenburg 4a61dfec6d * Make HttpMethodConstraint case insensitive 2015-11-23 11:50:44 -08:00
Doug Bunting eb70b1c28c Remove `WebUtility` use and handle `IHtmlContent` return values from view components
- #3571 and part of #3123
- split `ContentViewComponentResult` in two
- add `HtmlEncoder` to `ViewComponentContext`
- remove use of `WebUtility.HtmlEncode()` and `HtmlDecode()`

nits: remove unused `using`s in files I had open
2015-11-23 11:12:44 -08:00
Doug Bunting 45ff0a269c Make `ModelBinderAttribute.BindingSource` setter `protected`
- #3428
- the `public` setter was not useful when this class is used as an attribute
- make property `virtual` to support other override patterns
- update existing test to use both override patterns
2015-11-20 16:31:27 -08:00
Ryan Nowak 8682fe0cfd Replace ActionBindingContext with ControllerContext
This change introduces ControllerContext for inside of Controllers, and
controller-specific extensibility points. ControllerContext carries with
it the model binding infrastructure needed to do all of the things that
controllers need to do.
2015-11-20 15:32:37 -08:00
Doug Bunting 62978229c4 Ease unit testing of `Controller.TryValidateModel()`
- #3586
- reverse conditions to access `_options.Value` only when test has set up an `IStringLocalizerFactory`
2015-11-20 10:37:07 -08:00
N. Taylor Mullen 2dc13b523d React to aspnet/Razor#358.
- Removed `WriteTagHelperAsync` methods from `RazorPage`.
- Moved `WriteTagHelperAsync` tests into Razor since `TagHelperOutput` is now an `IHtmlContent`.
- Updated code generation test files.

aspnet/Razor#358
2015-11-20 10:05:48 -08:00
John Luo d78abf267e Missed update when reacting to removing ApplicationServices from HttpContext 2015-11-19 21:07:33 -08:00
John Luo 46cd4ac1f0 Reacting to ApplicationServices removal from HttpContext 2015-11-19 16:32:58 -08:00
Pavel Krymets f25aab8df7 React to hosting changes 2015-11-19 16:12:50 -08:00
Doug Bunting 79d74127b9 Add temporary workarounds for aspnet/External#50 and aspnet/Mvc#3587 2015-11-19 15:50:00 -08:00
Ryan Nowak d6bda0ec11 CompilerCache should not compile multiple assemblies for the same page.
Fixes #3469
2015-11-19 15:12:15 -08:00
Pranav K 155bde0fcf Pass in the area name instead of the view name to a parameter that
requires an area name.

Fixes #3556
2015-11-18 17:50:14 -08:00
Doug Bunting 95b3d2c1dd Address PR comments
- removed `isMainPage` parameter to `GetPage()` and `FindPage()`
2015-11-18 15:59:46 -08:00
Doug Bunting 3be6167aa0 Switch concepts from misnamed `isPartial` to `isMainPage`
- `true` has the opposite meaning now but most changes are due to new parameters names in `IViewEngine`
  - use name names in `Microsoft.AspNet.Mvc.ViewFound` and not found events
- remove `IRazorPage.IsPartial` and `RazorView.IsPartial`
  - remove `IsPartial` properties from `Microsoft.AspNet.Mvc.Razor.BeginInstrumentationContext` and end events
- add parameter checks to `RazorView` constructor; instances are not retrieved from DI

nits:
- remove unused `cacheKey` parameter from `RazorViewEngine.CreateCacheResult()`
- correct duplicate test names in `RazorPageTest`
  - also `...OnPageExecutionListenerContext` -> `...OnPageExecutionContext`
2015-11-18 15:59:37 -08:00
Doug Bunting cf30bb730f PR comments and some smallish cleanup
- `IRazorViewEngine.MakePathAbsolute()` -> `GetAbsolutePath()`
- set `IsPartial` on all `IRazorPage` instances
- improve consistency of methods in `HtmlHelperPartialExtensions`
  - a couple unnecessarily passed `htmlHelper.ViewData`
  - add missing tests of these extension methods
- restore parameter checks in `CompositeViewEngine`
- reduce `List<string>` and remove enumerator allocations in `CompositeViewEngine`

nits:
- correct a few comments
- use `<seealso/>`
2015-11-18 15:59:28 -08:00
Doug Bunting d1fe824b5d Improve `SearchLocations` handling
- do not blindly use `FindPage()` / `FindView()` result in `Exception.Message` or returned results
  - failure scenarios involve new `Any()` calls but rarely additional `List<string>()` allocations
- change `ViewEngine_ViewNotFound` resource to be consistent with similar errors
  - remove trailing period at end of searched locations list

nit: remove remaining `null` checks of `SearchedLocations` in not found cases; never `null` then
2015-11-18 15:59:20 -08:00
Doug Bunting 08dd77d8c7 Add relative view path support
- #3307
- relative paths are now supported in `View()` calls from components and view components,
  `Html.PartialAsync()` and similar calls, and `RazorPage.Layout` settings.
  - support absolute paths, relative paths, and view location lookups consistently / everywhere
  - support view paths in `TemplateRenderer` e.g. passing an absolute path to `Html.EditorFor()`
- take a big swing at the `IRazorViewEngine` and `IViewEngine` interfaces
  - split lookups (view names) from navigation (view paths)
  - remove `Partial` separation; use parameters to set `IsPartial` properties
- correct `ViewContext` copy constructor and add unit test
- extend unit tests to cover relative paths
  - fix existing tests to handle newly-required extension in an absolute path
- add functional test that chains relative paths

nits:
- remove some YOLO line wrapping
- `""` -> `string.Empty`
2015-11-18 15:59:11 -08:00
Kiran Challa 85080ae621 Make Cors filters run before any other authorization filters 2015-11-18 10:51:49 -08:00
Kiran Challa 982c7abea8 [Fixes #3503] Removing formatters on a given type only works on collections in MVC options 2015-11-18 09:56:44 -08:00
Ryan Nowak a65a6a7cab React to change in Razor 2015-11-18 09:53:24 -08:00
Pranav K b520b0cb22 Limit [FromServices] to apply only to parameters
Fixes #3507
2015-11-17 16:41:04 -08:00
herecydev db94a8ed19 Removed redundant null checks and tested logging 2015-11-17 15:32:54 -08:00
Ajay Bhargav Baaskaran 01102bba3f Moving Attribute Routing to Routing 2015-11-17 11:02:58 -08:00
Ryan Nowak e75eebbed0 Pool JsonSerializer for Output formatting 2015-11-16 10:43:02 -08:00
Pranav K f6270de387 Updating Microsoft.AspNet.Mvc.WebApiCompatShimTest to use Microsoft.Extensions.DependencyInjection 2015-11-13 13:40:31 -08:00
Pranav K e8427349a1 Missed one type in DI reaction 2015-11-13 11:12:50 -08:00
Pranav K 292207d17d Reacting to DependencyInjection changes 2015-11-13 10:47:34 -08:00
Ajay Bhargav Baaskaran b8b222b295 Replace InnerAttributeRoute with TreeRouter 2015-11-12 15:52:51 -08:00
ryanbrandenburg b8d58133c3 * Add NoContent Factory to Controller 2015-11-12 14:56:05 -08:00
N. Taylor Mullen a1af85beb7 Remove System beta tag in project.json for coreclr packages. 2015-11-12 12:24:39 -08:00
Cesar Blum Silveira 4a68550e50 Merge branch 'release' into dev 2015-11-11 10:59:32 -08:00
Kirthi Krishnamraju 454ff9f52a fix #3414 : RegularExpressionAttribute generates wrong data-val-regex message 2015-11-10 10:27:53 -08:00
Pranav K 380a93d370 Redesign RazorViewEngine caching
Fixes #3337
2015-11-10 10:18:25 -08:00
Doug Bunting 845b86963e Fix build break: React to aspnet/Hosting@660f1ca 2015-11-09 21:09:21 -08:00
Ryan Nowak ece6ecde45 Add buffer pooling to JsonResult 2015-11-09 15:43:33 -08:00
Kirthi Krishnamraju 3da2c35e3e fix #2819: Add more unit tests for ViewLocalizer and HtmlLocalizer 2015-11-09 10:54:56 -08:00
Pranav K d17db92e19 Log messages to DiagnosticListener in addition to page instrumentation
Fixes #3281
2015-11-09 10:24:49 -08:00
Pavel Krymets 737a8f3b1d Make Compilation Abstractions naming consistent with Platform Abstractions 2015-11-06 15:53:08 -08:00
N. Taylor Mullen d564a4a96b React to aspnet/Razor#561.
- `TagHelper` directives no longer have quotes.
- Regenerated test output.
2015-11-06 12:31:55 -08:00
Ajay Bhargav Baaskaran 1927730f40 [Fixes #3426] Removed defensive copy in CompositeModelBinder and CompositeModelValidatorProvider 2015-11-06 12:21:08 -08:00
N. Taylor Mullen decf882341 Update `LinkTagHelper`s `meta` tag to be w3c compliant.
- Prior to this change the `<meta ...>` generated had a name attribute. As an alternative we're using the `content` attribute in conjunction with the `name` attribute to ensure compliance.

#3449
2015-11-06 12:15:55 -08:00
Ajay Bhargav Baaskaran f7a211c095 Removed use of LINQ and added some optimizations in ValidationVisitor 2015-11-06 11:56:52 -08:00
N. Taylor Mullen bebd3dc9a0 Update test files to showcase block level Razor statements in attributes.
- Block level Razor statements in attributes used to not work. Added a few use cases to ensure that they're properly tested.

aspnet/Razor#594
2015-11-06 11:11:40 -08:00
Kiran Challa 5364468001 [Fixes #3177] Clean up logic for encoding in ViewResult and friends 2015-11-06 10:44:09 -08:00
ryanbrandenburg cd761a644d * Adding test 2015-11-04 13:55:02 -08:00
Pranav K 940fb7ba78 Adding Controller.Challenge and Controller.Forbid 2015-11-04 09:57:19 -08:00