Commit Graph

1747 Commits

Author SHA1 Message Date
Pranav K d87d8283d0 Use latest build of dotnet-test-xunit 2016-04-19 14:54:07 -07:00
Pavel Krymets e6ffb060f7 Bring Microsoft.NETCore.Platforms dependency back 2016-04-18 17:20:15 -07:00
Pavel Krymets 42c3397b6e Migrate tests, tools and samples to portable 2016-04-18 17:20:15 -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
John Luo 059179b7b8 Add web.config to test sites 2016-04-13 16:12:56 -07:00
Sébastien Ros f30f61f7bb Fixing functional test random failure (#4452) 2016-04-12 10:44: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 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 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
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
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
David Fowler 29646153ea Explicitly add tracesource dependency 2016-04-05 00:02:49 -07:00
Sebastien Ros 304135f4a6 Removing and ignoring .orig files 2016-04-04 17:36:25 -07:00
Kiran Challa cda1307848 Updated test to fix build break 2016-04-03 08:01:15 -07:00
Kiran Challa 4cd3012886 Fix mixed route for action error message 2016-04-03 06:55:11 -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
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
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
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
John Luo 22b37fb83b Update samples and react to Kestrel extensions 2016-03-30 17:33:25 -07:00
Doug Bunting 6bf25cecec React to HttpAbstractions namespace changes
- aspnet/HttpAbstractions#549 and aspnet/HttpAbstractions#592
- clean up `using`s
2016-03-30 16:19:42 -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
N. Taylor Mullen 7d43851952 React to aspnet/Razor#720. 2016-03-29 15:30:49 -07:00
Sebastien Ros 3924557b87 Fixing race condition in cache helpers unit tests 2016-03-29 10:59:26 -07:00
Pranav K 12d7093278 Revert "Remove DependencyModel dependency"
This reverts commit 4299a4d50b.
2016-03-29 07:29:43 -07:00
N. Taylor Mullen b7c90c4a67 React to aspnet/Razor#719. 2016-03-28 17:05:14 -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
Sebastien Ros 49e0a958c5 Fixing race in unit test 2016-03-28 10:30:16 -07:00
David Fowler 5ddb17d2fe Fixed packages 2016-03-25 12:27:49 -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
John Luo 555a8d0a3b Reacting to Hosting changes 2016-03-24 12:10:09 -07:00
Ajay Bhargav Baaskaran 5238a8f16e Added tests for DropDownList and ListBox extensions 2016-03-22 16:51:27 -07:00
Pranav K 06289945d0 Reacting to CoreCLR package changes 2016-03-22 14:49:43 -07:00