Commit Graph

2270 Commits

Author SHA1 Message Date
Ryan Nowak 3ed0d01eae Fix #4929 - Move IActionInvokerFactory from .Internal
Also added a wealth of doc comments to an area that's not currently super
well documented.
2016-07-05 13:18:34 -07:00
Doug Bunting 15f25d569a Improve `IUrlHelper` and related doc comments
- #4245, #4507
2016-07-05 09:34:33 -07:00
Doug Bunting 42cea41737 Fail more gracefully when option collections cleared
- #4690
- move `ModelBindingMessageProvider` init from `DefaultBindingMetadataProvider` to `DefaultModelMetadata`
 - in addition to avoiding error cases, this removes some boilerplate
- add specific errors to `BodyModelBinderProvider`, `CompilerCache`, `CompositeViewEngine`, `ModelBinderFactory`,
  and `ObjectResultExecutor`
 - `DefaultRazorViewEngineFileProviderAccessor.FileProvider` now a `NullFileProvider` in empty case
2016-06-30 14:52:50 -07:00
Medeni Baykal a852352223 Fix for https://github.com/aspnet/Mvc/issues/4903. (#4907)
Fix for https://github.com/aspnet/Mvc/issues/4903.
- `HtmlHelperTextAreaTest` added
- fix up `HtmlHelperTextBoxTest`
2016-06-29 10:11:54 -07:00
Crystal Qian e51a118a9d Added consistent model property to view result variants (#4901)
* Added consistent model property/tests to ViewResult, PartialViewResult, ViewComponentResult. This resolves #4813.

* Removed unnecessary model asserts

* Removed redundant model checking
2016-06-28 09:38:37 -07:00
Pranav K a1f4786695 Updating json files to pin versions and build files to pin KoreBuild 2016-06-27 13:51:10 -07:00
Crystal Qian c319ae51a5 Changed min/max parameter order in StringLengthAttributeAdapter (#4899)
Changed min/max parameter order in StringLengthAttributeAdapter. This fixes #4864.
2016-06-27 10:21:50 -07:00
Pranav K 72dbda8804 Update to 1.0.1 version 2016-06-24 09:40:03 -07:00
Crystal Qian dad6374258 Revert "Changed min/max parameter order in StringLengthAttributeAdapter"
This reverts commit d19765802b.
2016-06-22 15:34:53 -07:00
Crystal Qian d19765802b Changed min/max parameter order in StringLengthAttributeAdapter 2016-06-22 15:33:33 -07:00
Shahriar Gholami 94fa34ca41 TempData convenience property added to ViewComponent (#4873)
* TempData convenience property added to ViewComponent

 #4728

* PR feedback
2016-06-17 10:15:50 -07:00
Pranav K cd7954a164 Updating to dev versions 2016-06-16 10:40:11 -07:00
jacalvar 70af8cf79e Update Json.NET to 9.0.1 2016-06-15 15:11:56 -07:00
Doug Bunting b5a6303bb6 Address more PR comments 2016-06-10 14:49:49 -07:00
Doug Bunting 3a6541af10 Address PR comments 2016-06-10 14:26:14 -07:00
Doug Bunting 1f6bbf9967 Add doc comments for `public` attributes
- #4641
2016-06-10 14:26:14 -07:00
Kiran Challa a2feeab545 Changed the form tag helpers execution order to be more explicit.
[Fixes #4824] Fix Travis failure for test Microsoft.AspNetCore.Mvc.FunctionalTests.TagHelpersTest.ReregisteringAntiforgeryTokenInsideFormTagHelper_DoesNotAddDuplicateAntiforgeryTokenFields
2016-06-10 11:27:48 -07:00
Pranav Krishnamoorthy 55e9adf84d Generate portable pdbs in coreclr 2016-06-09 17:12:24 -07:00
Ryan Brandenburg 5339a3e0ce Add ExceptionHandled to ExceptionContext (#4825) 2016-06-09 15:22:11 -07:00
Pranav K 8c8fd6446b Use regular PDBs on full desktop when possible
Add a test to verify exceptions thrown from views is pretty printed by diagnostics middleware

Fixes https://github.com/aspnet/Diagnostics/issues/293
Fixes #4737
2016-06-09 14:59:38 -07:00
Ryan Nowak a8142b8858 Fix #4614 - update IModelBinder docs 2016-06-09 14:21:07 -07:00
Kiran Challa f1982bd987 Suppress default status code response type in api descriptions when explicit response types have been provided
[Fixes #4823] How to override the default (200) status code with ProducesResponseType
2016-06-09 12:07:52 -07:00
Doug Bunting 62803d5979 Serialize JSON using camel case by default
- #4283
- update `JsonSerializerSettingsProvider` to choose the `CamelCaseNamingStrategy`
2016-06-09 11:58:23 -07:00
Ryan Nowak 31ec88526a Fix #4801 Rename ValidationExcludeFilter
'ValidationExcludeFilter' -> 'SuppressChildValidationMetadataProvider'

Also moved to .ModelBinding for improved discoverability. There aren't
many reasons user code would have a using for .Validation.
2016-06-09 10:51:31 -07:00
Ryan Nowak baf0b6a5c7 Fix #4803 - Move some types internal
Moves IControllerArgumentBinder and IControllerPropertyActivator into
.Internal. Also renames ControllerArgumentBinder ->
DefaultControllerArgumentBinder for consistency with other controller
extensibility types.

We don't think these are 100% baked for our long term maintenance of the
product, and want to reserve the ability to make changes in the future.
2016-06-09 09:36:15 -07:00
jacalvar 22232bc1bf Fix incorrect import 2016-06-09 01:14:08 -07:00
jacalvar 0c2189e473 Remove unncessary imports 2016-06-09 00:35:44 -07:00
Doug Bunting aecfe778ee Improve handling of custom `ValidationAttribute`s and their `ValidationResult`s
- #3595 sub-items 2 through 4
- handle an indexer name in `ValidationResult.MemberNames`
 - aligns `ModelNames.CreatePropertyModelName()` with `TemplateInfo.GetFullHtmlFieldName()`
- handle multiple elements in `ValidationResult.MemberNames`
 - later elements previously ignored
- set `ValidationContext.MemberName` to `null` when no property name is available
 - using type name for a member name was just wrong
2016-06-08 12:05:01 -07:00
Derek Gray 5a3875ea72 Alter content negotiation algorithm so that it can be configured (via
MvcOptions) to always respect an explicit Accept header. Fixes #4612.
2016-06-07 16:12:36 -05:00
Ryan Nowak 2e2784aa3d [Design] Split up MvcRouteHandler
This change splits up the conventional routing path from the attribute
routing path *inside* routing, instead of inside `MvcRouteHandler`. Each
attribute route group now gets its own instance of
`MvcAttributeRouteHandler` which just knows about the actions it can
reach.

This removes the concept of a route-group-token and removes the lookup
table entirely for attribute routing. This also means that the
`DefaultHandler` on `IRouteBuilder` will not be used for attribute routes,
which we are OK with for 1.0.0.

The action selector's functionality is now split into two methods. We
think this is OK for 1.0.0 because any customization of `IActionSelector`
up to now had to implement virtually the same policy as ours in order to
work with attribute routing. It should now be possible to customize the
selector in a meaningful way without interfering with attribute routing.
2016-06-07 08:12:47 -07:00
jacalvar 62748b9471 Update Json.NET to 9.0.1-beta1 2016-06-06 21:49:39 -07:00
Ryan Nowak 78c130d226 Fix for #4666 - reduce modelbinders created
This change to ModelBinderFactory makes the caching much more aggressive,
by caching all non-root binders. There's some trickiness here around
making sure we have the right behavior when all providers return null. See
the tests and comments.

I also kept the change I made for a temporary workaround to use a
dictionary rather than a "stack" for cycle breaking.  This seems like an
overall improvement in clarity.
2016-06-06 09:01:51 -07:00
Derek Gray 53b890aab5 Fix filename for DefaultPropertyFilterProvider 2016-06-02 14:56:34 -05:00
Derek Gray 5f36adbee3 Fix filename for ModelValidatorProviderContext (fixes #4798) 2016-06-02 14:34:33 -05:00
N. Taylor Mullen 51c285574b Add `AdditionalCompilationReferences` option to `RazorViewEngineOptions`.
- `AdditionalCompilationReferences` is a purely additive option to add `MetadataReference` instances to be used for Razor compilation.
- Added a test to validate the compilation references get combined with the `ApplicationPartManager`s metadata references.

#4497
2016-06-01 16:32:46 -07:00
mnltejaswini 659cdc3364 React to aspnet/Razor#765. 2016-06-01 11:05:13 -07:00
jacalvar ed8c744041 [Fixes #4218] Adds a comment justifying the use of service locator in this case 2016-05-31 23:59:31 -07:00
jacalvar 4b5df98bc3 [Fixes #4224] Remove use of service locator on ViewExecutor 2016-05-31 23:39:22 -07:00
jacalvar 6a6d2e0d9f [Fixes #4506] Move and rename ActionDescriptor.Name to ControllerActionDescriptor.ActionName 2016-05-31 23:13:20 -07:00
jacalvar 5f4ca4fa66 [Fixes #4223] Added a facade for ViewComponentResult 2016-05-31 22:47:33 -07:00
jacalvar 8493064fe5 [Fixes #4207] Review IActionResult classes and add facades as necessary.
* Moved FileResults to use executor façades
* Changed redirect result types to use executor façades.
2016-05-31 22:46:18 -07:00
Ajay Bhargav Baaskaran 283573d6c9 [Fixes #4291] Simplified MvcRouteHandler code 2016-05-31 15:02:14 -07:00
Hao Kung c7a46e4caf AuthPolicy should use IPolicyProvider 2016-05-31 13:47:58 -07:00
Doug Bunting e63f094a5f Use type metadata for `ModelBinderProviderContext.BindingInfo`
- #4652
- previously ignored for top-level models
- `ModelBinderProviderContext.BindingInfo` is now never `null`
- similarly, use type metadata (as well as parameter info) for `ModelBindingContext.BinderModelName`
 - previously ignored when overridden in `ControllerArgumentBinder`
2016-05-27 23:00:29 -07:00
N. Taylor Mullen cfd58f1747 React to aspnet/Razor#705
- Updated `ScriptTagHelper` and `LinkTagHelper` to maintain their quotes on generated script tags.
- Removed `TagHelperOutputExtensions`. It's no longer needed.
- We no longer string replace quotes directly. We rely on encoding and the initial representation of an attribute to ensure quotes don't break generated attributes.
- Updated tests.
2016-05-27 12:00:01 -07:00
John Luo 5eed7b9b88 React to updated CoreCLR packages
https://github.com/aspnet/Coherence/issues/97
2016-05-26 18:31:05 -07:00
Pranav K bb226aef6b Update Mvc.Core and dependencies to netstandard1.6 2016-05-26 16:52:04 -07:00
Michiel Post b6794ab1b7 Fixed null reference on ModelStateDictionary.ChildNodes when calling Clear 2016-05-26 16:12:49 -07:00
Shahriar Gholami 42dd4499e0 Fixed a bug in TagBuilder when attribute value is null
#4710
2016-05-26 11:04:32 -07:00
Pranav K 5d72a7f747 Modify ICompilationLibrariesProvider to return a sequence of reference path
Fixes #4738
2016-05-25 16:20:23 -07:00
Pranav K 9acd0f578c Remove IDisposable contract from IMvcRazorHost
Fixes #4709
2016-05-25 14:43:12 -07:00
Ajay Bhargav Baaskaran 3d0f436a06 [Fixes #4294] TypeActivate MvcRouteHandler 2016-05-25 12:57:16 -07:00
mnltejaswini b96851ec20 [Perf] Avoid ViewBuffers for writing bound TagHelper attribute values. Fixes aspnet/Razor#717 2016-05-25 12:14:26 -07:00
Hao Kung f54a964815 AuthZFilter should call into Service more 2016-05-24 14:42:54 -07:00
Pranav K 15f113ddb1 Remove IControllerTypeProvider 2016-05-24 14:36:02 -07:00
Pranav K 90f0e29923 Inject the IRazorViewEngine directory instead of using GetRequiredService 2016-05-24 10:40:33 -07:00
Pranav K ab76f743f4 Use dependency context from all application parts when compiling views
Fixes #4498
2016-05-24 10:28:51 -07:00
Pranav K 69e029fc79 Update the namespace for Razor generated code to AspNetCore
Fixes #4476
2016-05-23 16:25:59 -07:00
Ryan Nowak d92b3ba2c6 Make ModelBindingContext.Result non-nullable
This change simplifies a bunch of code and fits more in line with the
current design of model binding.

Now, a model binder only has to do anything if it was successful.
'return' is enough to indicate failure.
2016-05-23 14:18:34 -07:00
Ryan Nowak 88c9ae6588 Remove Key from ModelBindingResult 2016-05-23 13:17:19 -07:00
jacalvar 230a13d0e1 [Fixes #4633] Datetime? and DateTimeOffset? values on InputTagHelper are not rendered correctly. 2016-05-20 11:29:29 -07:00
jacalvar ee2a591d2c [Fixes #4655] Make comparisons in DefaultAssemblyPartDiscoveryProvider case insensitive 2016-05-20 11:22:55 -07:00
jacalvar a490cf13a6 [Fixes #4555] Assemblies with a transitive dependency to MVC are not included as part of the list of discovered assemblies 2016-05-20 11:18:34 -07:00
jacalvar b1054a28c7 [Fixes #4353] Cleanup application part discovery 2016-05-20 10:56:03 -07:00
Kiran Challa 93be3dee6e Fix FormTagHelper to set flag indicating generation of AntiforgeryToken
[Fixes #4595] Better error message with extraneous @Html.AntiforgeryToken
2016-05-20 04:29:01 -07:00
Kiran Challa 20a2e748ec Added ValueProviderFactories to ResourceFilterExecutingContext
This enables removing value provider factories from model binding(which is needed in some scenarios like large file uploads)
2016-05-20 04:15:07 -07:00
mnltejaswini df4eb283b2 [Perf] UrlHelper shares a single RouteValueDictionary across several calls to Action and RouteUrl methods 2016-05-19 16:15:46 -07:00
mnltejaswini d7ccea17ce [Perf] Refactoring ControllerActionInvoker to avoid coercing action method's return type to Task<object> for simple cases. Fixes #4539 2016-05-19 14:21:29 -07:00
Kiran Challa f7b2ee80fd [Fixes #4550] Add an Option to set the Razor view location formats 2016-05-19 14:04:33 -07:00
Pranav K 61883b5101 Fix more schema warnings in Mvc 2016-05-18 18:25:45 -07:00
mnltejaswini 74357b3ed8 [Perf] Fast Generate Url for specific cases to avoid string allocations 2016-05-18 18:08:25 -07:00
Kristian Hellang 0f8542e4b2 Throw a more descriptive exception for missing CORS policies 2016-05-18 17:54:17 -07:00
Ryan Brandenburg 941da9264b Move ModelBindingHelper to Internal (#4664) 2016-05-18 16:52:43 -07:00
Pranav K 78be3ad135 Revert "Update Minor versions (#4657)"
This reverts commit e731a327cf.
2016-05-18 09:11:20 -07:00
Ryan Brandenburg e731a327cf Update Minor versions (#4657) 2016-05-17 12:40:20 -07:00
N. Taylor Mullen 55922d68d4 React to `HtmlEncodedString` rename to `HtmlString`.
- Removed the Mvc instance of `HtmlString` since it now exists in `HtmlAbstractions`.

#4558
aspnet/HtmlAbstractions#25
2016-05-17 11:02:10 -07:00
Kristian Hellang 230776f4b0 Added Permanent property to configure RequireHttpsAttribute
Fixes #4561
2016-05-16 16:18:53 -07:00
mnltejaswini 61a176e478 [Perf] Cache the default values for action arguments to avoid Activator.CreateInstance per argument.
Fixes #4470
2016-05-16 11:43:34 -07:00
mnltejaswini 5fb36ae406 [Perf] Replace Activator.CreateInstance with cached delegate in RazorPageFactoryProvider
Fixes #4470
2016-05-16 11:26:33 -07:00
mnltejaswini 0e4b838864 [Perf] Replace Activator.CreateInstance with cached delegate in Model Binders
Fixes Part1 of #4470
2016-05-16 11:26:33 -07:00
N. Taylor Mullen fa29396141 Revert "Add Visual Studio specific RC1 binaries."
This reverts commit 687fd72efd, a140440196, 698980943a and 3ebb14ee4b.

#4405
2016-05-16 11:12:24 -07:00
Ryan Nowak 1e02fd2e6b Merge invoker back into one class
This will help future generations maintain this class. Notice that the
protected methods that are going away all just call into another
extensibility point (other than the executor). If we need to we could make
that extensible in the future and then we have the same support with fewer
hooks and less complexity.
2016-05-13 17:43:59 -07:00
Ryan Nowak 51e133ab9f Add asserts to DiagnosticSource 2016-05-13 15:05:35 -07:00
Ryan Nowak 652e330875 Fix #4631 and avoid Task<T> creation in invoker
This change corrects and ordering bug between the creation of the
'context' and the diagnostic source event that occurs before a synchronous
filter's 'after' stage.

Also made some simple changes to avoid allocating Task<T> in many common
cases. Now we'll only create the Task<T> when we really need it (async
filters).
2016-05-13 08:53:56 -07:00
Ryan Nowak 128d74e2a0 Refactor Argument Binder
This change just rearranges some code in the argument binder with a mind
towards performance and clarity. We're removing a few Task<T>'s here as
well in certain cases, but not yet all of them. We additionally save a
dictionary in the case where you have bound properties.

Hopefully these changes break the code into more discrete and sensible
units without multiple levels of indirection without abstraction.
- Main 'driver' code
- BindModel
- ActivateProperty
2016-05-13 08:12:14 -07:00
Ryan Nowak 4d63ffa879 Make ValueProvider creation lazy
We want this change to avoid MVC eagerly reading the form. This is good
for general perf and also for scenarios where you want read the body
yourself (large file uploads).

We DO have scenarios where you want to configure the value providers
per-request or also to change the limits on the value providers (form) so
it's worth keeping these around on the context.
2016-05-13 08:11:21 -07:00
Kiran Challa e483478415 Merge branch 'release' into dev 2016-05-12 09:35:33 -07:00
Ryan Nowak fb5d92bdc0 Change our cached task to a field
This makes it more inlinable and saves a volatile lookup on netstandard.
2016-05-11 18:09:21 -07:00
Ryan Nowak 04ffc4d2eb Clean up DiagnosticSource code in invoker 2016-05-11 17:41:03 -07:00
Kiran Challa d6a9068008 [Fixes #4616] Filter caching is too aggressive 2016-05-11 16:58:45 -07:00
Ryan Nowak 7bd297c395 Remove unused field 2016-05-11 16:48:55 -07:00
Kiran Challa 3c2bdfd368 Merge branch 'release' into dev 2016-05-03 12:29:33 -07:00
Kristian Hellang f4679fe74f Changed RequireHttpsAttribute to default to 302 instead of 301 2016-05-03 12:11:18 -07:00
David Obando 742a9e3f3b Reduce the number of allocations during model validation
When the service receives a model (say, via a POST message) MVC validates it to ensure the model is in a correct state. Validation currently incurs in many allocations that can be avoided. This tackles two of them:
  1. We're now caching the generic `GetEnumerator<T>` method infos generated on the fly during collection validation, and
  2. We're now only initializing `ModelErrorCollection` on demand.

The first one incurs in the additional allocation of 1 long-lived dictionary object, which will grow only to the amount of `Collection<T>` types used by the model being validated. This is expected to be a small to medium number.

The second change assumes that class `ModelStateEntry` isn't thread safe, as model validation isn't multithreaded.

This resolves #4434 and #4435.
2016-05-02 19:28:20 -07:00
Ryan Brandenburg c6a6aae15f Merge branch 'release' into dev 2016-05-02 16:52:29 -07:00
Ryan Brandenburg 3aa42617a4 Add transitive reference 2016-05-02 16:49:57 -07:00
Pranav K 3d494fd732 Merge branch 'release' into dev 2016-05-02 14:58:54 -07:00
Pranav K 36146a6139 Fix build warnings 2016-05-02 14:52:02 -07:00
Kiran Challa d30290c310 Merge branch 'release' into dev 2016-05-02 13:36:35 -07:00
Kiran Challa ad065892fd [Fixes #4575] Logging ArgumentOutOfRangeException 2016-05-02 13:16:08 -07:00
jacalvar c85c22282b Merge branch 'release' into dev 2016-05-02 12:26:37 -07:00
jacalvar 059ec0f353 [Fixes #4525] Get rid of DNX services 2016-05-02 12:16:08 -07:00
Pranav K 0ff2f875d9 Avoid holding on to DependencyContext instance
Fixes #4527
2016-04-29 14:44:55 -07:00
mnltejaswini cba4d1dd0c [Perf] Reduce SelectListItem and other allocations when generating HTML for select lists
Fixes #3953
2016-04-29 11:58:02 -07:00
Filip W f567258f14 changed GetFormat to virtual 2016-04-27 18:08:45 -07:00
Doug Bunting d8d2e54506 Remove extra options to manipulate `JsonSerializerSettings`
- #4339: remove non-recommended JSON formatter constructors
 - affects `JsonInputFormatter`, `JsonOutputFormatter`, `JsonPatchInputFormatter`
 - `JsonOutputFormatter` cleanup also impacts `JsonHelper`
 - rename and make `SerializerSettingsProvider` class public; use it as appropriate
- #4409: make `SerializerSetings` properties get-only and `protected`
 - affects `JsonInputFormatter`, `JsonOutputFormatter`

Recommended patterns:
- change `JsonSerializerSettings` values in `MvcJsonOptions` for almost all customizations
- find `JsonOutputFormatter` in `MvcOptions.OutputFormatters` when limiting per-result formatters
- start with `JsonSerializerSettingsProvider.CreateSerializerSettings()` when customizing a per-result formatter
2016-04-27 14:48:16 -07:00
mnltejaswini 0788edbd4b [Perf] Cache the metadata for known type "object"
Fixes #4377
2016-04-25 13:03:52 -07:00
Pranav K b3a65b485f Simplify assembly load on CoreCLR
Fixes #4328
2016-04-25 09:45:23 -07:00
Ryan Nowak 756cd2dab8 Remove OperationBindingContext
This change trims a few concepts that aren't really needed inside
ModelBinders anymore, and removes the OperationBindingContext class.
2016-04-25 09:29:03 -07:00
Kiran Challa 4e8e30437f Merge branch 'release' into dev 2016-04-23 06:57:08 -07:00
Ryan Nowak af58c2e6b6 Streamlining action selection and route values
Removes a few concepts we don't need
Improves documentation
More things are IDictionary instead of other random types
2016-04-22 17:36:23 -07:00
Kiran Challa a259638d79 Filters provided by filter providers are made to never be cached
[Fixes #4504] Possible double-execution of filter providers
2016-04-22 16:56:08 -07:00
mnltejaswini f1fe5e26fc [Perf] RazorPage.CreateModelExpression is allocating expression names
Fixes #4469
2016-04-22 12:55:28 -07:00
Sebastien Ros 4b4d67e48e Merge branch 'release' into dev 2016-04-22 11:54:56 -07:00
Sébastien Ros 2c639f83c4 Fixing BindNever attribute and Type model binding
Fixes #4505
2016-04-22 11:52:08 -07:00
Ryan Nowak 8efd12187c Remove unused interface 2016-04-21 14:01:46 -07:00
jacalvar 683356ea59 Merge branch 'release' into dev 2016-04-21 10:39:45 -07:00
Ryan Nowak 87704c67e1 React to routing cleanup 2016-04-21 07:55:20 -07:00
jacalvar d9aacd0f87 [Fixes 4509] Stop registering disposable objects in our controller helper methods 2016-04-20 17:00:34 -07:00
mnltejaswini 73dc7bf48b [Perf] Check for Logger.IsEnabled in logging methods of MvcCoreLoggerExtensions
Fixes #4466
2016-04-19 11:49:56 -07:00
Doug Bunting 1492db35fa Merge branch 'release' into dev 2016-04-16 13:07:08 -07:00
mnltejaswini 4e97c72eeb [Perf]:Cache TypeConverters in SimpleTypeModelBinder
Fixes #4361
2016-04-15 18:23:49 -07:00
Doug Bunting 7a1ac034f9 Special-case use of `razorPage.Model` property in `ExpressionMetadataProvider`
- #3978
- better-aligns `ExpressionMetadataProvider` with `ExpressionHelper`

nit: mock less in `RazorPageCreateModelExpressionTest`
2016-04-15 17:15:33 -07:00
mnltejaswini a565f9ff58 [Perf] Reduce DefaultTagHelperContent allocations in LinkTagHelper and ScriptTagHelper
Fixes #4468
2016-04-15 13:29:49 -07:00
mnltejaswini fa34f61d46 [Perf] Avoid Service Provider lookups when activating common Singleton properties of a Razor Page
Fixes #4244
2016-04-14 16:52:25 -07:00
BrennanConroy 588abbc588 Merge branch 'release' into dev 2016-04-14 15:55:14 -07:00
BrennanConroy 010e8a4e37 Move dependency to netstandard only 2016-04-14 15:54:59 -07:00
BrennanConroy 4f8c1d49d0 Merge branch 'release' into dev 2016-04-14 13:53:24 -07:00
BrennanConroy b35814f035 Add serialization.primitives for Newtonsoft.Json 2016-04-14 13:53:10 -07:00
Ryan Nowak a73db1a9bd Fixes #4471 - Don't call Enum.ToString() 2016-04-14 10:15:55 -07:00
Doug Bunting ee2cfa1963 Merge remote-tracking branch 'origin/release' into dev 2016-04-13 16:04:14 -07:00
Doug Bunting eda647e270 Complete the doc comments for filters
- #3851
- add lots of words
- correct that vs. which confusion
2016-04-13 16:01:30 -07:00
Ryan Nowak cffc381a69 Update xproj output path 2016-04-13 14:03:44 -07:00
Eilon Lipton 0cf9a4b7f2 Merge branch 'release' into dev 2016-04-13 12:10:53 -07:00
Eilon Lipton 4f24339740 Fix package metadata 2016-04-13 12:07:04 -07:00
Ryan Nowak 84caf6968d Merge branch 'release' into dev 2016-04-11 15:50:26 -07:00
Ryan Nowak 3ec60a0181 Fix #4447 - Teach MVC to understand defaults
The wireup for defaults in attribute routes was missing
2016-04-11 14:38:29 -07:00
Doug Bunting 82fd17d050 Merge branch 'release' into dev 2016-04-08 16:06:59 -07:00
Doug Bunting a0c8834c70 Preserve existing metadata in `ViewDataDictionary` where possible
- #4116
- generalize rules for `ModelMetadata` creation; minimize metadata changes when Model is updated
 - down to a single special case in VDD for `Nullable<T>`
 - note existing functional tests did not need to change
- remove `ViewDataDictionary(ViewDataDictionary, object)` constructor; use `new VDD<object>(source, model)`
- allow all `Model` assignments in a view component
 - copy-constructed VDD in `ViewComponentContext` previously preserved the source's declared type

nits:
- do not call `virtual SetModel()` method from constructor; now mostly redundant
 - logic in copy constructor and `SetModel()` is consistent but different enough to keep code separate
- add some missing doc comments
- fix doc comment property versus type confusion; never need to specify `ViewDataDictionary.` prefix
- fix a few `TemplateBuilder` comments and remove unnecessary `model: null` argument to VDD constructor
2016-04-08 14:44:36 -07:00
Ryan Nowak 7b50ea39da Merge branch 'release' into dev 2016-04-08 12:26:52 -07:00
Ryan Nowak a55544681d Fix for #3659 - handle IHtmlContent in localization
This change corrects handling of IHtmlContent instances in
LocalizedHtmlString by making using of FormattableHtmlString.
2016-04-08 11:20:49 -07:00
mnltejaswini f4e35f5ba0 [Perf] Remove the validations in ControllerActivator and ViewComponentActivator which are redundant. These
validations are already done when selecting a controller and view component
Fixes #4367
2016-04-08 10:07:33 -07:00
Pranav K 2bf79a874d Removing imports from src projects 2016-04-08 06:49:31 -07:00
Pranav K 1d4363305c Merge branch 'release' into dev 2016-04-08 06:49:31 -07:00
Ryan Nowak d4c7dc3a83 Make HashSets in TempData lazy
TempData is frequently created but not modified, this reduces the cost of
that without much complexity.
2016-04-07 13:09:56 -07:00
Pranav K cf460e9a63 Merge branch 'release' into dev 2016-04-06 19:04:58 -07:00
Pranav K 67f54e82f9 Fix versioning 2016-04-06 18:15:14 -07:00
Ryan Nowak 3b3bfb5a69 Remove using Task.FromResult where possible
Believe it or not, this one in ActionResult is showing in TechEmpower. I
did a pass on all of the product code since the cache task actually
improves the readability of the code 😎
2016-04-06 16:06:45 -07:00
N. Taylor Mullen 3ebb14ee4b Update Resource lookup keys for VSRC1 packages. 2016-04-06 11:43:09 -07:00
Sébastien Ros efb8ef33e6 Fixing race in distributed cache tag helper
Fixes #4407
2016-04-06 09:42:24 -07:00
Pranav K c66c408c15 DefaultAssemblyPartDiscoveryProvider.IsCandidateLibrary should not look at types in Mvc assemblies
Fixes #4363
2016-04-06 08:41:12 -07:00
David Fowler 4b348699c8 Fixed dependencies
Fix dependency on System.Runtime.Serialization.Xml
2016-04-05 23:28:53 -07:00
N. Taylor Mullen ee80f5f84c React to aspnet/Razor#621. 2016-04-05 16:08:01 -07:00
Pranav K 7cb1dca467 JsonInputFormatter fails to use custom SerializerSettings
Fixes #4270
2016-04-05 10:19:49 -07:00
N. Taylor Mullen a140440196 Add `AssemblyCompany`, `AssemblyCopyright` and `AssemblyProduct` attributes to the assembly. 2016-04-04 16:25:47 -07:00
N. Taylor Mullen 687fd72efd Add Visual Studio specific RC1 binaries.
- This is needed for Visual Studio RC1 backwards compatibility.
2016-04-04 15:21:19 -07:00
Pranav K 701869fd53 Remove DefaultAssemblyPartDiscoveryProvider.GetAssemblyName
Fixes #4366
2016-04-03 10:37:10 -07:00
Pranav K 330e98d1fc Revert "Revert "Updating to the newest Roslyn packages""
This reverts commit 87e89befc8.
2016-04-03 09:07:31 -07:00
Pranav K b4310ac8a8 Modify RoslynCompilationService to generate portable pdbs
Fixes #4330
2016-04-03 08:55:11 -07:00
Kiran Challa 4cd3012886 Fix mixed route for action error message 2016-04-03 06:55:11 -07:00
N. Taylor Mullen 56bbb215ec React to aspnet/Razor#721. 2016-04-03 00:00:19 -07:00
jacalvar 574ecbb3eb [Fixes #4087] Add support for AddTagHelpersAsServices()
* Added TagHelperFeature and TagHelperFeatureProvider to perform tag helper discovery.
* Changed tag helper discovery to use application parts when using tag helpers as services.
* Added FeatureTagHelperTypeResolver to resolve tag helper type definitions from the list of application parts.
* Added AddTagHelpersAsServices extension method on IMvcBuilder and IMvcCoreBuilder that
  performs tag helper discovery through the ApplicationPartManager and registers those tag helpers as
  services in the service collection. Assemblies should be added to the ApplicationPartManager
  in order to discover tag helpers in them in them. The @addTagHelper directive is still required on
  Razor pages to indicate what tag helpers to use.
2016-04-02 10:32:48 -07:00
Doug Bunting 384fd1f218 Quick fix: Address a couple of nits in / around `ViewDataDictionary`
- remove duplicate `null` checks in `ViewDataDictionary` constructors
- correct a couple of code comments
- use a `public` constructor for `ViewDataDictionary` in `ViewExecutor`
2016-04-01 15:31:47 -07:00
Sebastien Ros 341430eae5 [Fixes #4246] Introducing CacheTagKey
Prevent string allocations in CacheTagHelper
Fix hash collision by checking the serialized key with the actual content for DistributedCacheTagHelper
2016-04-01 15:06:29 -07:00
BrennanConroy f22e234dab React to logging changes 2016-04-01 12:00:33 -07:00
ryanbrandenburg 906ac728c7 Null-check PagedBufferedStringWriter 2016-04-01 11:50:46 -07:00
jacalvar f638c051fa Remove IAssemblyProvider and update DNX to work with application parts.
* Remove IAssemblyProvider.
* Remove DefaultAssemblyProvider in favor of DefaultAssemblyPartDiscoveryProvider.
* Update AddMvcDnx to add the list of DNX discovered assemblies to the list of application parts.
2016-04-01 11:01:09 -07:00
jacalvar 5246125cb7 [Fixes #4087] Add AddViewComponentsAsServices() and ServiceBasedViewComponentActivator
* Added ViewComponentFeture and ViewComponentFeatureProvider to perform view component discovery.
* Changed view component discovery to use application parts.
* Changed ViewComponentDescriptorProvider to make use of Application parts.
* Added AddViewComponentsAsServices method on IMvcBuilder that performs view component
  discovery through the ApplicationPartManager and registers those view components as
  services in the service collection. Assemblies should be added to the ApplicationPartManager
  in order to discover view components in them in them.
2016-04-01 10:55:04 -07:00
Pranav K 87e89befc8 Revert "Updating to the newest Roslyn packages"
This reverts commit 50af106b6a.
2016-04-01 10:44:33 -07:00
jacalvar 0d0aad41f5 [Fixes #4014] Add overload to AddControllerAsServices that uses the default controller discovery logic.
* Added ControllerFeature and ControllerFeatureProvider to perform controller discovery.
* Changed controller discovery to use application parts.
* Changed ControllerActionDescriptorProvider to make use of Application parts.
* Simplified AddControllerAsServices to not accept any parameter and perform
  controller discovery through the ApplicationPartManager in the IMvcBuilder
  and IMvcCoreBuilder. Assemblies should be added to the ApplicationPartManager
  in order to discover controllers in them.
2016-04-01 09:29:37 -07:00
Pranav K 50af106b6a Updating to the newest Roslyn packages 2016-04-01 07:11:50 -07:00
Ryan Nowak 144766f2e3 Simplify BindAttribute - rename PredicateProvider
This change renames IPropertyBindingPredicateProvider to
IPropertyFilterProvider. The changes here are mostly renames of
parameters/variables from predicate -> propertyFilter. I did a
find+replace and left the term 'predicate' in some of the docs because it
refers to a predicate in the abstract sense.

This change also simplifies BindAttribute and removes support for type
activation.
2016-03-31 12:34:02 -07:00
jacalvar 1bd66ffda0 [Fixes #4089] Add support for application parts
This commit introduces application parts as a concept on MVC.

An application part is an abstraction that allows you to expose some
feature or corncern in a way that is decoupled from their underlying source.
Examples of this include types in an assembly, emdeded resources, files on
disk etc.

Application parts are configured during startup by adding or removing them from
the application part manager available as part of IMvcBuilder and IMvcCoreBuilder.

The application part manager provides the ability to populate features from the
list of available application parts by using a list of application feature providers.
Application feature providers are responsible for populating a given feature given a
list of application parts.

Examples of application providers can be a ControllerFeatureProvider
that goes through the list of application parts, sees which one of those parts exposes types,
determines which of those types are controller types, and adds them to a ControllerFeature
that holds a list of all the types that will be considered controllers in the application.
2016-03-31 12:14:04 -07:00
mnltejaswini 7fbd407ad5 [Perf] Rewrite ExpressionHelper.GetExpressionText using StringBuilder 2016-03-31 11:26:37 -07:00
jacalvar de9ffb13c7 [Fixes #3732] Simplify controller discovery.
* Introduce ControllerAttribute and use it to mark base classes as controllers.
* Changed rules for controller discovery to:
  * All controller types must be public, concrete, non open generic types.
  * NotController attribute is not applied to any type oif the hierarchy.
  * The type name ends with controller.
  * Controller attribute is applied to the type or to one of its ancestors.
2016-03-31 10:50:26 -07:00
jacalvar 680e9bb2d1 Refactor and cleanup tag helper creation.
* Moved instantiation of tag helpers into DefaultTagHelperActivator.
* Introduced ITagHelperFactory for handling the setup of new tag helper instances.
2016-03-31 10:47:17 -07:00
Ryan Nowak 96e5c7b22e Always clear buffers returned to the memory pool
Just a safety measure in case anything evades our 'flattening'. I don't
have any evidence that we're failing to clear something, but we want this
here as a safeguard.
2016-03-30 16:12:30 -07:00
jacalvar b04bb124b0 [Fixes #4317] UrlResolutionTagHelper doesn't work with TagHelpers that run before and supress output 2016-03-30 15:55:11 -07:00
Kiran Challa e0212752e5 Removing AuthorizationFilterAttribute as we do not want users to easily create their own authorization implementation. They should instead
use authorization policies and requirements(IAuthorizationRequirement) to enforce authorization.
[Fixes #4233] AuthorizationFilterAttribute returns UnauthorizedResult rather than ChallengeResult
2016-03-30 15:34:41 -07:00
Ryan Nowak e1abb47b98 Fix #4238 IFormFile model binder suppresses validation
This change no longer suppresses validation for IFormFile and
IFormFileCollection model values. This will allow the use of [Required] on an
IFormFile model, or a custom attribute for validating IFormFileCollection.

These types already have ValidateChildren = false, so we don't recurse
into them.
2016-03-30 14:09:28 -07:00
Kiran Challa 6e9a6a2db1 Added new attribute ProducesResponseTypeAttribute to enable ApiExplorer to expose response type and StatusCode.
[Fixes #4101] StatusCode Metadata
2016-03-30 11:51:58 -07:00
Ryan Nowak fb81a5e11e Introducing ModelBinderFactory
This change separates model binding into IModelBinderProvider (decides
which binder to use) and IModelBinder (does binding). The
IModelBinderFactory is a new services with coordinates the creation of
model binders.
2016-03-29 15:45:14 -07:00
Pranav K 12d7093278 Revert "Remove DependencyModel dependency"
This reverts commit 4299a4d50b.
2016-03-29 07:29:43 -07:00
Pranav K 529fa67c2b Adding tests for PrefixContainer
Fixes #4045
2016-03-28 14:31:17 -07:00
Kévin Chalet f9d24a8521 Introduce SignInResult/SignOutResult and ControllerBase.SignIn/SignOut 2016-03-28 12:45:42 -07:00
Doug Bunting 749a51e9ae Quick fix: Another typo in the same resource name 2016-03-26 17:36:38 -07:00
Doug Bunting ea9acda0b8 Quick fix: Correct typo in resource name 2016-03-26 17:01:19 -07:00
ryanbrandenburg 5fe284a486 SetContent->SetHtmlContent 2016-03-25 16:48:06 -07:00
ryanbrandenburg e8d0cc1668 SetContent->SetHtmlContent 2016-03-25 12:09:07 -07:00
Doug Bunting 43836aec18 An `ObjectPoolProvider` is always registered
- react to aspnet/Hosting/pull#673
2016-03-25 11:20:15 -07:00
Sebastien Ros 476d2eb81d Reacting to changes in Caching 2016-03-25 10:56:34 -07:00
mnltejaswini 66ff9939c3 Cache Member Access Expression Text to avoid ExpressionHelper.GetExpressionText
Part 1 Fix for  #3921
2016-03-25 09:12:02 -07:00
Pranav K 8c35a4e315 Remove transitive dependency 2016-03-23 13:07:19 -07:00
Pranav K 06289945d0 Reacting to CoreCLR package changes 2016-03-22 14:49:43 -07:00
ryanbrandenburg a78f77afde Add StatusCode helpers to ControllerBase 2016-03-21 15:26:13 -07:00
Ajay Bhargav Baaskaran 8e6b4980e3 [Fixes #4310] Moved AuthorizeFilter and CorsAuthorizationFilter to a public namespace 2016-03-21 11:54:03 -07:00
mnltejaswini fd984563c3 [Perf] Optimize CoerceResultToTaskAsync to remove MethodInfo.Invoke 2016-03-17 16:12:55 -07:00
Pranav K fb07fee465 Reduce grunt work in Mvc 2016-03-17 15:25:33 -07:00
Pranav K f651f18d3a Use a prefix tree as a backing store for ModelStateDictionary 2016-03-17 10:09:36 -07:00
Ryan Nowak fec1268bf3 Remove ModelBinding features from ResourceFilters
Removes all of the ModelBinding configuration support from Resource
Filters. We haven't come up with concrete scenarios around these features,
and don't want to paint ourselves into a corner with extensibility.
2016-03-16 16:33:14 -07:00