Commit Graph

1200 Commits

Author SHA1 Message Date
Harsh Gupta 60fa4a6f45 Adding Support for consumes.
Consumes has overriding behavior and the one closest to action wins.
2015-01-16 14:15:08 -08:00
Youngjune Hong dfb02e58f8 Merge branch 'dev' of github.com:aspnet/Mvc into dev 2015-01-16 13:57:32 -08:00
Youngjune Hong 0d2a819255 Remove Controller.ViewEngine property+unit tests and simplify the Content method 2015-01-16 13:44:03 -08:00
Pranav K a94d5223e1 Modify RoslynCompilationService to read MetadataReferences from the target 2015-01-16 12:39:04 -08:00
Ajay Bhargav Baaskaran b02dea98e7 Using set instead of add in Created ActionResults 2015-01-16 12:34:40 -08:00
Ajay Bhargav Baaskaran 7c0eb56e59 ContentResult sets Charset along with ContentType
- Sets default ContentType and Charset if null
- Added relevant unit and functional tests
2015-01-16 12:24:44 -08:00
Ajay Bhargav Baaskaran a5a3eb44b9 Activation behavior modification made easier
- Made Activate method virtual
 - Changed IReadOnlyDictionary to IDictionary
2015-01-16 12:15:28 -08:00
Yishai Galatzer 9ac37fbc7a Rename TextPlainFormatter and remove other minor warnings
#1631
2015-01-16 12:09:53 -08:00
David Fowler 90f2ece84d Work around dependency resolution problem 2015-01-16 03:01:51 -08:00
Hao Kung 7b2fb55ef6 React to Security Auth changes 2015-01-15 23:41:52 -08:00
sornaks 262bb9a732 Changes introducing ResponseCache to cache content in the client/proxy. 2015-01-15 16:51:22 -08:00
Doug Bunting d2fe1ebad7 Allow `@Model` in bound tag helper attribute value
- part II of #1253
- an expected case in template .cshtml files
- expression has name `""`; led to `ArgumentException` in `ModelExpression`
- test `@Model` and `@model.Property` in unit and functional tests
- update baselines to match

nits:
- remove a few unecessary `@`s in .cshtml files
- correct field names & ids in ProductList.cshtml (`foreach` confuses MVC)
 - led to correct valiation attributes as well
2015-01-15 16:47:27 -08:00
Doug Bunting a77d071830 React to aspnet/Razor#268 changes
- part I of #1253 using new Razor capabilities
- update baselines to match latest code generation
- use new `CodeBuilderContext` and `TagHelperAttributeValueCodeRenderer` signatures
- test complex expressions in bound non-string attribute values
2015-01-15 16:47:22 -08:00
Ryan Nowak 3dea6b11a3 Issue #1695 - Create a pattern for a 'greedy' model binder.
See #1695 for a detailed explanation. This change builds support into the
system for the case that a model binder returns true without setting a
value for the Model.

In this case, validation will be skipped if it's a top-level object.

Note that explicitly setting null will still run validation.
2015-01-15 16:32:50 -08:00
Ryan Nowak 623b733eaa Adding a sample (test) for using custom IRouter implementation with MVC
This is a demonstration of how to inject an IRouter in between traditional
routes and MVC's handler. This allows you to accomplish a variety of
things that were possible with WebAPIs handlers, but inside the routing
system.

The example here turns a header representing the user into a locale, which
is used to select a controller. You could do other things like reject the
route match or change link generation.

There is one subtle project change here, to allow the same to be possible
for attribute routing, we need to create the attribute route after running
the user's routing configuration code.
2015-01-15 16:31:21 -08:00
Kiran Challa 02f4ca9f05 [Fixes #1791]Remove XML formatter from defaults 2015-01-15 15:46:49 -08:00
Chris Ross 9aff289dfe Handle PipelineCore rename. 2015-01-15 15:25:17 -08:00
Pranav K bef9af4679 Fixing build break
* Run ModelBinding test that uses Moq to run under ASPNET50
* Update AssociatedValidatorProviderTest to reflect API changes
2015-01-15 14:20:00 -08:00
Pranav K fe1bcc7a24 ElementalValueProvider performs incorrect prefix check in
ContainsPrefixAsync

Fixes #1814
2015-01-15 14:02:41 -08:00
Pranav K b24cec0add Add net45 as a target framework for Microsoft.AspNet.Mvc.Common 2015-01-15 14:02:36 -08:00
Ajay Bhargav Baaskaran 437eb93bde File upload model binder
- Support for binding posted file to type IFormFile
- Support for multipart/form-data in FormValueProviderFactory
- Updated Mvc Sample
- Added relevant unit and functional tests
2015-01-15 13:41:14 -08:00
Kirthi Krishnamraju 6a824a4394 Added ModelMetadataType Attribute and logic to get attributes from ModelMetadata class 2015-01-15 13:19:10 -08:00
Pranav K 6641997836 Add support for `@removeTagHelpers` inheritance from _ViewStart files
Fixes #1657
2015-01-15 12:12:00 -08:00
Harsh Gupta 106b9fc30c Adding proper descriptions in readme.md files for functional tests. 2015-01-15 11:12:48 -08:00
Chris Ross 91d7e382d1 Consume new strongly typed headers. Remove temp implementations. 2015-01-14 15:51:34 -08:00
N. Taylor Mullen 8529ea2f0d React to aspnet/Razor#240.
- Updated tests to account for new casing.
2015-01-13 22:35:43 -08:00
NTaylorMullen 4c20352e2a Updated test files to react to aspnet/Razor#260. 2015-01-13 21:32:05 -08:00
Doug Bunting 89fd1abc58 Nit: Clean up duplicate tests
- lead to errors during test discovery in VS
2015-01-13 12:49:26 -08:00
Doug Bunting 6e68637af1 Nit: Remove unneeded sample dependencies on Microsoft.AspNet.Mvc.TestConfiguration 2015-01-13 12:49:22 -08:00
Doug Bunting c0d27ee56d Add `CultureReplacerMiddleware` for use in functional test web sites
- #1766
- use `ReplaceCultureAttribute` to avoid `CultureReplacer` thread consistency checks
- also update test expectations to match new formats

nit: use `UseMiddleware()` extension method rather than `app.Use()`
2015-01-13 12:49:02 -08:00
Youngjune Hong 40e479c915 MvcTagHelpers tests for
1) A few `<input/>` tag helpers in a partial view invoked (`@Html.PartialAsync()`) in a loop within a `@for` inside an `using @Html.BeginForm()` block.
2) A custom template e.g. EditorTemplates/MyType.cshtml containing a mix of `<input/>`, `<select/>`, and various input HTML helpers invoked (`@Html.Editor[For]()`) in a loop within a `@for` inside an `using @Html.BeginForm()` block.
3)  `<select/>` tag helpers with an `using @Html.BeginForm()` block
4) HTML helpers in the <form/> tag helper
2015-01-13 10:12:19 -08:00
Pranav K cbea96cf37 Reacting to Roslyn version change 2015-01-13 08:19:49 -08:00
Pranav K b7d44666b8 Adding support for flowing compilation errors to Diagnostics middleware
Fixes #872
2015-01-13 07:32:58 -08:00
Ajay Bhargav Baaskaran 62b6ab8721 Added missed license header and removed unused file 2015-01-12 17:42:05 -08:00
Ryan Nowak 08b83fefc3 Some cleanup of action invoker and related code
The action invoker no longer needs access to model metadata or to the
input formatter selector. This change removes the same as constructor
parameters and cleans up tests which use the invoker.
2015-01-12 16:44:39 -08:00
Ryan Nowak 61d9c2cbf8 fix build break 2015-01-12 14:36:21 -08:00
Ryan Nowak 5ac5c53c09 Adding Resource Filters
This is a new filter stage that surrounds the existing model binding,
action, and result parts of the pipeline. Resource Filters run after
Authorization Filters.

The other major change is to support one of the primary scenarios for
Resource Filters. We want a filter to be able to modify the inputs the
model binding (formatters, model binders, value providers, etc) -- this
means that those changes need to be held on a context object and preserved
so that they can be used in the controller.

So, IActionBindingContextProvider is removed - the ActionBindingContext
will be created by the invoker. For now it will be part of the action
context.
2015-01-12 14:18:20 -08:00
stanislavromanov 990473aebc Change remark for FlushAsync method. close #1721 2015-01-12 14:07:58 -08:00
Ajay Bhargav Baaskaran 3dedef422a Merged compiler/resources with Compiler/Resources 2015-01-12 13:29:37 -08:00
Ajay Bhargav Baaskaran 191af4a5a9 added activation tests for tag helpers 2015-01-12 12:51:41 -08:00
Hao Kung 63940bee87 Fix doc comments 2015-01-12 11:47:08 -08:00
Hao Kung 157b633758 React to IContextAccessor -> IScopedInstance 2015-01-12 10:25:21 -08:00
Youngjune Hong f8cb519c2f Adding the functional tests for MvcTagHelpers (1) 2015-01-08 17:23:42 -08:00
Ajay Bhargav Baaskaran 52a984c52d react to aspnet/HttpAbstractions#146 changes 2015-01-07 17:53:35 -08:00
Doug Bunting 6df288bce7 Correct StyleCop violations
- StyleCop working again (handles C# 6.0 additions) though only locally for me
- disable some new rules:
 - ConstFieldNamesMustBeginWithUpperCaseLetter
 - InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements
 - StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements
 - StaticReadonlyFieldsMustBeginWithUpperCaseLetter
 - PrefixCallsCorrectly
- correct remaining violations
 - lots of long lines for example
 - use more `var`; some manual updates since StyleCop doesn't check seemingly-unused blocks

nit: remove new trailing whitespace (was paranoid about adding it w/ fixes)
2015-01-06 16:23:57 -08:00
Kiran Challa 227f564098 Logging functional tests using ElmLogger 2015-01-06 16:16:12 -08:00
Ryan Nowak 0a473b0600 Remove ParameterModel.IsOptional
The ParameterModel and ParameterDescriptor have had a notion of
optionality for a while now, even though all parameters are treated as
'optional' in MVC.

This change removes these settings. Optionality for overloading in webapi
compat shim is reimplemented via a new binder metadata.
2015-01-06 15:22:13 -08:00
Ryan Nowak fb21b736ee Issue #1754 - Change List to IList in application model 2015-01-06 15:16:04 -08:00
sornaks 5262dfd577 Adding SerializableError - a serializable container for the purpose of output conneg. 2015-01-06 14:07:45 -08:00
Ajay Bhargav Baaskaran 51567194dc deleted duplicate action results in WebapiCompatShim 2015-01-06 11:07:22 -08:00