Commit Graph

1612 Commits

Author SHA1 Message Date
Ryan Nowak cea8d019f1 Add logging and scope for ViewComponent 2015-10-23 15:25:00 -07:00
Ajay Bhargav Baaskaran eb398c811d Added LocalRedirectresult
- Fixes #3346
- Added helper method in controller
- Added relevant tests
2015-10-23 12:58:41 -07:00
Ajay Bhargav Baaskaran b6d7012c27 [Fixes #3279] Added DiagnosticSource for filters 2015-10-23 12:53:00 -07:00
Ajay Bhargav Baaskaran 624c918de5 [Fixes #3274] Added DiagnosticsSource for ViewComponent 2015-10-23 12:51:12 -07:00
Ryan Nowak bcde82cf62 Use buffer pooling in IOutputFormatters 2015-10-23 08:10:30 -07:00
Pavel Krymets 4e8c543489 Rename Microsoft.Runtime.Abstractions to Microsoft.Extensions.PlatformAbstractions 2015-10-22 19:48:55 -07:00
ryanbrandenburg 0b8fe87596 * Allow null ViewData and TempData 2015-10-22 17:28:26 -07:00
N. Taylor Mullen 911dfc57b0 Transition `SelectTagHelper` and `OptionTagHelper` to use `context.Items`.
- Added functional tests to validate data created from a `SelectTagHelper` does not impact following `<select>` tags.
- Also moved the new `SelectTagHelper` communication flow into `TagHelper.Init`.

#3347
2015-10-22 17:17:01 -07:00
Doug Bunting c267ef3904 Rename `AppendEncoded()` to `AppendHtml()` and `SetContentEncoded()` to `SetHtmlContent()`
- #3225, 3 of 3
2015-10-22 16:57:47 -07:00
N. Taylor Mullen faa78a3d91 Transition from `IAssemblyLoadContext` to `AssemblyLoadContext`.
- `IAssemblyLoadContext` is a DNX defined type that will eventually go away.

#3365
2015-10-22 16:15:10 -07:00
N. Taylor Mullen 493a556168 Fixed xml docs build error. 2015-10-22 16:11:17 -07:00
Doug Bunting 40b7636b72 Use `ModelMetadata.GetDisplayName()` in error message replacing `FormatException` and `OverflowException`
- #3227
- much of change is to tests, creating and passing `ModelMetadata`
- updated `InputFormatterContext` to make `ModelMetadata` available to `JsonInputFormatter`
  - walk `ModelMetadata` tree to get information about property with an issue
- add missing `null` checks in `ModelStateDictionaryExtensions`
2015-10-22 15:50:36 -07:00
N. Taylor Mullen 9b9d72f3f7 Remove unneeded namespaces.
aspnet/Razor#578
2015-10-22 15:34:40 -07:00
N. Taylor Mullen 0ae83a25e9 React to aspnet/Razor#571.
- Changed all `GetChildContentAsync` calls to come from `TagHelperOutput` instead of `TagHelperContext`.
- Updated `ReaderAtEndOfFormTagHelper` to properly detect changes inside of a `Form`s body by calling the `Init` method.
- Add test to `RenderAtEndOfFormTagHelperTest`.

aspnet/Razor#571
2015-10-22 14:51:14 -07:00
N. Taylor Mullen 0e25470660 React to aspnet/Razor#578. 2015-10-22 14:41:40 -07:00
Henk Mollema 34d4dfdef8 Rename Context to HttpContext in ViewComponent and RazorPage
Rename the property to `HttpContext` to be consistent with the `Controller` class.
Fixes #3332
2015-10-22 14:39:55 -07:00
N. Taylor Mullen 8623946784 Add compilation services when adding Razor.
#3383
2015-10-22 11:49:02 -07:00
Ryan Nowak f2af02b1cb Improve logging behavior for actions scope 2015-10-22 11:23:04 -07:00
Ryan Nowak dcec94f6d9 Change ActionMethodExecuted to be Verbose 2015-10-22 10:21:36 -07:00
Pranav K 91aeec95e9 Switching to generations TFMs 2015-10-22 01:20:00 -07:00
ryanbrandenburg da731fc641 Add logging to ActionResults and ControllerActionInvoker 2015-10-21 13:16:14 -07:00
Ryan Nowak 1474ed8fe8 Fix breaks to xml docs 2015-10-20 23:31:02 -07:00
Ryan Nowak 3576939457 Fix break in XmlSerializerOutputFormatter tests
The wrong type is being passed in to the wrapper-provider for
XmlSerializer. DCS formatter is already correct.
2015-10-20 22:25:56 -07:00
Ryan Nowak 800e46eed4 Fix failures in StringOutputFormatter functional tests
The missing piece here is is that StringOutputFormatter needs to set the
ContentType so that it gets overridden. The problem is that the formatter
is likely called with something like application/json, but decides to
write a string anyway. So because we're saying 'yes we can write' we also
need to override what we're writing.
2015-10-20 22:12:21 -07:00
Eilon Lipton 55b72c04bf Add high-pri doc comments for views, controllers, HTML helpers, Startup 2015-10-20 18:24:56 -07:00
Ryan Nowak 38b65875db Refactor of OutputFormattterContext 2015-10-20 18:05:57 -07:00
Pranav K 8b0c157296 Rename ModelState (the type) -> ModelStateEntry
Fixes #3326
2015-10-20 16:43:00 -07:00
Ryan Nowak 173f00fda7 Update to use DiagnosticSource 2015-10-20 11:47:29 -07:00
Ryan Nowak 054b39013c Reduce allocations in MSD enumeration 2015-10-20 10:35:16 -07:00
Ryan Nowak 06cc58663e Move implementation of ObjectResult into a facade 2015-10-19 11:56:03 -07:00
Ajay Bhargav Baaskaran 6bd97c7c30 Moving AllowAnonymous attribute to Authorization 2015-10-19 11:01:15 -07:00
Pranav K f4a6d634b5 Modify ViewStartUtility to generate always view paths with forward slashes
Fixes #3294
2015-10-19 10:33:05 -07:00
unknown 6a4da5d795 PhysicalFileResult throws NotSupported on path not rooted 2015-10-16 13:31:52 -07:00
Ryan Nowak 32645e93c8 Add expression rewriting to Razor
This change rewrites simple and safe Expression<Func<T, U>> expressions
into accesses to readonly fields. This allows us to cache the actual
expression and avoid repeatedly allocating and compiling it.

The rewrite is limited to cases where we know that the expression doesn't
capture, and where we support that kind of expression for evaluating
viewdata. In practice this means 'indentity' and property accessors are
allowed.
2015-10-16 12:28:50 -07:00
Ajay Bhargav Baaskaran 6ef2fe44ca [Fixes #3250] Remove RouteGroup from RouteValues 2015-10-16 10:57:22 -07:00
Doug Bunting 9b004611e5 Address PR comments for 2e2043f (PR #3317)
- remove redundant `null` check in `InputFormatter`
- improve comments
- rename `ObjectResult.SelectFormatterBasedOnTypeMatch()` -> `SelectFormatterNotUsingAcceptHeaders()`
2015-10-15 20:26:03 -07:00
Kiran Challa fbf66168fe React to Cors api review changes 2015-10-15 13:05:08 -07:00
Hao Kung fd17481a73 React to AuthZ changes 2015-10-14 17:04:31 -07:00
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 9aed5efd51 Add `null` checks for MVC tag helpers 2015-10-14 11:27:25 -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
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