Commit Graph

1687 Commits

Author SHA1 Message Date
Pranav K 017bf1a20f Changes to use moq-netcore 2015-11-25 16:04:04 -08:00
Ryan Nowak 0832365ec2 Adds ActionContext to OperationBindingContext
This change makes it possible to access the ActionContext/ActionDescriptor
from inside of modelbinding.
2015-11-25 15:17:09 -08:00
Kiran Challa 31e42ee312 [Fixes #3433] Invalid media type 'text/plain; charset=utf-8' 2015-11-25 10:50:40 -08:00
Ryan Nowak 4bcf236450 MVC companion to aspnet/Routing#238
This is a companion change to make the RouteValueDictionary type more
promient. Using the concrete type here allows to avoid allocations in a
lot of common scenarios.
2015-11-25 10:36:50 -08:00
Doug Bunting 6e299d695f Update `DefaultHtmlGenerator.GenerateAntiforgery()` to match latest `IAntiforgery.GetHtml()`
- #3123 (3 of 5 or so)
- react to rest of aspnet/Antiforgery@6a9b38d
  - remove `HtmlEncoder` from localization requirements
  - literal `hidden` is no longer HTML encoded (was a no-op anyhow)
2015-11-25 09:49:15 -08:00
Doug Bunting 7bb0a1a4fe Update `IJsonHelper` to use `IHtmlContent`
- part of #3123 (2 of 5 or so)
- do not expose specific `HtmlString` class
2015-11-25 09:49:05 -08:00
Pranav K ba1d064b99 Cleaning up RazorPage 2015-11-25 09:20:55 -08:00
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
Pranav K b622a5b0d3 Bump Razor to dotnet5.5 2015-11-23 15:31:59 -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
Ryan Nowak bbdfbf4cc3 Remove per-instance string.Concat 2015-11-23 10:25:42 -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
apxoht 535fdf3356 Removed unnecessary call to MetadataProvider.GetModelExplorerForType in Controller.TryValidateModel 2015-11-20 15:41:42 -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
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
Pavel Krymets 349b2f3963 Add HttpContextAccessor because Hostring doesn't do it by default 2015-11-18 14:44:35 -08:00
Doug Bunting b3c68defe8 Change `IViewComponentHelper` methods to return `IHtmlContent`
- #3152
2015-11-18 12:21:39 -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
N. Taylor Mullen 73f557002f Add `AddDataAnnotationsLocalization` parameterless overload.
- The `IMvcBuilder` extension methods already had this overload, just adding it to `IMvcCoreBuilder`.

#3517
2015-11-17 10:05:18 -08:00
Ryan Nowak e75eebbed0 Pool JsonSerializer for Output formatting 2015-11-16 10:43:02 -08:00
Ryan Nowak ccfd235f50 React to change in HtmlAbstractions 2015-11-16 09:49:20 -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
ryanbrandenburg ed46885586 * Log correct message for Found/NotFound views 2015-11-12 14:53:00 -08:00
N. Taylor Mullen a1af85beb7 Remove System beta tag in project.json for coreclr packages. 2015-11-12 12:24:39 -08:00
Ryan Nowak 5810154826 Avoid creating intermediate strings with THCWTW
This textwriter needs to inherit HtmlTextWriter and the
StringCollectionTextWriter needs to have the right conditional test.

This allows us to 'pass-through' any IHtmlContent instances without
writing out intermediate strings.
2015-11-11 16:59:46 -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
Ryan Nowak ece6ecde45 Add buffer pooling to JsonResult 2015-11-09 15:43:33 -08:00
Pranav K d17db92e19 Log messages to DiagnosticListener in addition to page instrumentation
Fixes #3281
2015-11-09 10:24:49 -08:00
Doug Bunting cef4a66479 Another `System.RuntimeSerialization.Xml` version update
- #3493
- see also d4163b4

nit: sort properties
2015-11-07 15:34:07 -08:00
Pavel Krymets 737a8f3b1d Make Compilation Abstractions naming consistent with Platform Abstractions 2015-11-06 15:53:08 -08:00