Commit Graph

2196 Commits

Author SHA1 Message Date
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
Pavel Krymets 11043cfda2 Remove another usage of CallContextServiceLocator 2015-10-22 14:12:52 -07:00
Pavel Krymets 84bfb8da3b Remove CallContextServiceLocator usages in tests 2015-10-22 12:15:48 -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
Chris R 5fd7d58ccd React to IHostingEnvironment initialization changes. 2015-10-22 08:39:16 -07:00
Pranav K 91aeec95e9 Switching to generations TFMs 2015-10-22 01:20:00 -07:00
Hao Kung 8a2694dd46 React to AuthZ namespace changes 2015-10-21 16:48:07 -07:00
ryanbrandenburg da731fc641 Add logging to ActionResults and ControllerActionInvoker 2015-10-21 13:16:14 -07:00
Pavel Krymets 5bb9759166 react to dnx di changes 2015-10-21 11:43:39 -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
Ryan Nowak d584bcabcf React to changes in Authz 2015-10-20 17:45:02 -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 6985015e2d Fix test breaks in WebAPI shim
This hasn't hit universe yet, but these needed to change with the
ObjectResult refactor
2015-10-19 18:00:02 -07:00
Kirthi Krishnamraju 82cba7c0b2 react to aspnet/localization #90 2015-10-19 16:15:57 -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
N. Taylor Mullen e943cdb57a React to aspnet/Razor#569 2015-10-16 15:09:31 -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
Pranav K 2dcec8fe51 React to Kestrel package rename
Fixes #3323
2015-10-14 16:39:13 -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 2e2043f427 Test `[FromServices]` with service that is not available
- test `[FromServices]` for a defined type without a `BinderModelName`
- test `[FromServices]` for a service not available in DI
- test `[FromServices]` for `IEnumerable<TService>` properties

nit: correct name of `ServicesModelBinderTest` to match the model binder class
2015-10-14 11:46:11 -07:00
Doug Bunting 9aed5efd51 Add `null` checks for MVC tag helpers 2015-10-14 11:27:25 -07:00
Doug Bunting c3ac457c20 Fix local build break 2015-10-12 12:59:16 -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
Doug Bunting 5a1c120392 React to aspnet/Universe#290 fix 2015-10-12 10:42:45 -07:00
Doug Bunting 35d176f5b2 Update DNX Core on Linux workarounds
- remove skip conditions for aspnet/External#33, aspnet/External#41, aspnet/External#42, aspnet/External#43
- add workaround for aspnet/External#47; avoid "g" custom datetime format specifier
- make tag helper execution order determinate in `TagHelpersWebSite`

Will test DNX Core in Travis builds (use `--test-dnxcore`) once aspnet/Universe#290 fix is in.

nits:
- remove useless `using`s for `Microsoft.AspNet.Razor.TagHelpers`
2015-10-10 23:09:51 -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