Commit Graph

440 Commits

Author SHA1 Message Date
Doug Bunting 4d4686147f Let VS do its thing
- newline after BOM and slight reordering of Mvc.sln
- add `Service/Include` properties to some test .xproj files
 - also add BOM in a few cases
2015-03-28 14:41:40 -07:00
Doug Bunting 9ac6ebd2b2 Refactor `IHtmlGenerator.GenerateSelect()` and address #2240
- add `IHtmlGenerator.GetCurrentValues()` method
 - bring together bits of `GenerateSelect()` and `UpdateSelectListItemsWithDefaultValue()`
 - get rid of ugly `out` parameter
 - also allows `<option/>` tag helpers to run before `<select/>` helper generation
- match `null` values and `SelectListItem`s with empty values
- match `enum` names correctly
- add doc comments for `IHtmlGenerator.GenerateSelect()` methods
2015-03-24 12:37:19 -07:00
Kirthi Krishnamraju a5da5b3acd Removed reflection code; used JsonContract instead and added new JsonPatchInputFormatter 2015-03-23 14:46:54 -07:00
Harsh Gupta 5818c0b5b7 Fixes #583 Generating a unique cookie name for an application. 2015-03-23 14:05:05 -07:00
ianhong c1eea5b3fa React to Should GetVirtualPath return PathString in Routing 2015-03-22 19:44:45 -07:00
Doug Bunting 570b1e583a Add `Html.GetEnumSelectList()` helpers
- #438 part 2/2

nit: test `[Display]` that does not set `Name` in `DataAnnotationsMetadataProviderTest`
2015-03-22 12:40:44 -07:00
Harsh Gupta adeb1ba194 Adding support for model binding specifically marked controller properties. 2015-03-20 17:37:09 -07:00
Ryan Nowak f5e7a69693 Updates to the extensibility for validator providers
This change removes reflection from validator providers, and instead
relies on cached metadata in in the modelmetadata.

In general this means that our MVPs don't need to cache anything, they
just look at the metadata and create what they need.

In the case of data-annotations, we update the model details provider to
add validation attributes to the modelmetadata. This would allow someone
to replace the DataAnnotationsValidatorProvider, but still use the
metadata in these attributes.

The change to the IModelValidatorProvider api (to use a context) is
intended to minimize allocations. Currently each validator provider needs
to return a list so you end up with N+1 lists (N validators + a final list
to compine them all). This change will let us just create the final list
(and a small context object). This is a very very high traffic API so it
seemed worth doing.

There's also some general massaging of namespaces and file locations.
2015-03-20 15:19:25 -07:00
Ryan Nowak 2b82ee0255 Refactor of ViewComponent extensibility
Adds ViewComponentDescriptor and caching (provider, collection,
collectionprovider).

Removes IViewComponentInvokerProvider, simplifies
IViewComponentInvokerFactory.
2015-03-20 13:39:54 -07:00
ianhong 1c6800beab List of assembly names in DefaultAssemblyProvider needs to be kept up to date 2015-03-20 11:38:43 -07:00
Kirthi Krishnamraju 2b246e7acc Fix for #1694 issue : Removed prefix for ModelState keys for FromBody parameters 2015-03-20 10:41:06 -07:00
ianhong 27bdec40a6 React to #154 (Routing - adding data token to GetVirtualPath) 2015-03-19 21:51:14 -07:00
Harsh Gupta ac908d405e Removing ModelMetadataProvider.GetModelMetadataForParameters 2015-03-19 16:42:54 -07:00
Ajay Bhargav Baaskaran 9c1e2f54a5 [Fixes #2157] Added additional functional tests for TempData 2015-03-19 15:55:23 -07:00
Hao Kung 4b5dd199ca React to hosting changes 2015-03-19 11:07:25 -07:00
Harsh Gupta 015edefa96 Cors Support in MVC. 2015-03-18 19:37:00 -07:00
Kiran Challa ee4ffea294 [Fixes #2190] Remove GetSupportedContentTypes method from IOutputFormatter and move to a separate metadata interface 2015-03-18 16:13:14 -07:00
Ajay Bhargav Baaskaran fc9e1caf43 [Fixes #1331] Register object for dispose in ObjectResult and
FileStreamResult
2015-03-17 17:04:05 -07:00
Kiran Challa 489fc52df8 [Fixes #2108] StringOutputFormatter fails when HttpNotAcceptableOutputFormatter is used 2015-03-17 11:04:46 -07:00
Ryan Nowak fc00aff7c5 Add TestCommon project 2015-03-16 13:49:29 -07:00
Kiran Challa 3d247ec028 [Fixes #2086] FilePathResult WriteFileAsync uses SendFile feature incorrectly 2015-03-16 13:05:12 -07:00
N. Taylor Mullen 385fa29407 Update xunit.runner.kre => xunit.runner.aspnet. 2015-03-12 18:01:41 -07:00
Hao Kung f3a9ce1ec1 Welcome home ScopedInstance 2015-03-11 15:03:29 -07:00
N. Taylor Mullen c1a026cbf7 Update .kproj => .xproj. 2015-03-11 14:01:43 -07:00
Kirthi Krishnamraju 7b18d1d3f1 Clear ModelState errors of model before TryValidateModel or TryUpdateModel 2015-03-11 10:14:28 -07:00
Ajay Bhargav Baaskaran db728cd386 Introducing TempData
- Issue #455
 - Updated MVC sample
 - Added relevant tests
2015-03-10 12:04:05 -07:00
N. Taylor Mullen 1d578ca2fd Remove BOM from project.json, *.cmd, *.sh and *.shade files. 2015-03-09 12:56:42 -07:00
N. Taylor Mullen e829ba7646 Update aspnet50/aspnetcore50 => dnx451/dnxcore50. 2015-03-08 12:52:24 -07:00
ianhong 1144ba72d5 Porting HttpUnauthorizedResult 2015-03-06 10:18:51 -08:00
Praburaj a9feed4de1 Rename Microsoft.AspNet.Http.Interfaces => Microsoft.AspNet.Http 2015-03-05 16:25:15 -08:00
Ryan Nowak 90cef3b9ca Refactor of the model metadata provider
Separates the MMP into two phases:
1). Creation of the ModelMetadata, discovery of properties and attributes
(reflection) is part of the MMP
2). Lookup of details based on attributes is now part of another phase,
and has its results cached.

Users can now implements and register an IFooMetadataProvider to customize
a single aspect of metadata (see how data annotations does it).
2015-03-05 13:19:10 -08:00
Brennan f4ea1b82fa Logging API changes 2015-03-04 21:07:45 -08:00
Hao Kung c290e897b0 React to DI 2015-03-04 19:26:54 -08:00
sornaks 284eb9ac6a Reacting to Razor changes - TagHelperOutput is writing to TextWriter instead of string. 2015-03-04 12:56:58 -08:00
Ajay Bhargav Baaskaran 81c3b75980 Replaced WebUtility.HtmlEnode with IHtmlEncoder.HtmlEncode 2015-03-03 13:57:36 -08:00
Hao Kung 46aaf790c4 React to AuthN changes 2015-03-02 16:14:38 -08:00
Doug Bunting ae4cafc002 Correct evaluation of expression result in `GenerateSelect()`
- #1468
- Always use `ModelExplorer` in `<select/>`, `DropDownListFor()` and `ListBoxFor()` cases
 - allows evaluation of more-complex expressions
- Use `ViewData.Model` in `DropDownList()` and `ListBox()` template cases
 - `ViewData` was previously ignored in these cases

nit: change `ViewDataDictionary.Eval()` to return `Model` if `expression` is `null` or empty
- now `throw` on `null` or empty `expression` name in `ViewDataEvaluator.Eval()`
- simplifies some of the higher-level code
 - no change to `selectList` fallback; `Model` incorrect for that case
 - no change to `GenerateRadioButton()`; would change behaviour unrelated to #1468
  - this helper uses incorrect `ViewData` lookup text, see #1487
2015-03-02 12:07:43 -08:00
Levi B b821b706b7 React to DataProtection rename 2015-02-25 17:31:02 -08:00
Ajay Bhargav Baaskaran dc49a2c194 Added HttpNotFoundObjectResult and added relevant tests 2015-02-24 11:57:48 -08:00
Kiran Challa 5bb69e495e [Fixes #1184] Formatting issues in requests should not cause a 500 response 2015-02-24 10:39:11 -08:00
Kiran Challa f737083c94 Added JsonContractResolver to validate value type properties 2015-02-24 06:34:35 -08:00
Ryan Nowak 9d5364cf9b Removing ModelMetadata.Model 2015-02-23 19:56:59 -08:00
Yishai Galatzer ed8e5716ea Remove INestedProviderXXX
React to aspnet/DependencyInjection#179
2015-02-23 15:18:39 -08:00
Kirthi Krishnamraju f6e701b2b2 Reverting #1837 and add non-generic overloads for TryUpdateModel 2015-02-23 10:02:51 -08:00
N. Taylor Mullen df4b92b1c1 Update MVC projects to utilize Common repo classes.
- Had to add extra dependencies to work around aspnet/XRE#1237.
- Updated src and test projects.
2015-02-22 18:23:28 -08:00
Luke Waters d9e2581c9a responding to interface break 2015-02-19 14:46:57 -08:00
Yishai Galatzer b12c4c5ef8 Cleanup services
Explicitly register nestedprovider managers
Make IActionSelector singleton
2015-02-19 11:14:09 -08:00
Praburaj 1f98918f1f PR feedback to StatusCode filter. 2015-02-19 09:44:13 -08:00
Doug Bunting 8eb63271b5 Make HTML helper parameter names consistent
- #944
- name `string` expression name and `Expression<Func<TModel, TResult>>`
  parameters "expression"
 - single special case is `GenerateIdFromName(string fullName)` since every
   other expression name is relative to the current
   `ViewData,TemplateInfo.HtmlFieldPrefix` value
 - applied from `IHtmlHelper` and `IHtmlGenerator` on up
- name `IHtmlHelper` and `IHtmlHelper<TModel>` parameters "htmlHelper"
- rename `TProperty` and `TValue` type parameters to `TResult`

nits:
- clean up abbreviated names in `CachedExpressionCompiler`
- change `ObjectToDictionary()`'s parameter name to `value`
- use `nameof` more to make renaming (and refactoring) easier in the future
- rewrap parameters and arguments to avoid long lines and orphans
2015-02-17 17:53:53 -08:00
Harsh Gupta f19c2e493d Merging Model Validation for body and non body validation.
This also fixes #1503.

Currently all model binders except mutable object binder are independent of validation code. The mutable object binder which needs to do some validation ( for scenarios involving [BindRequired] and [BindNever]).
We would be going with an approach where required validaiton happens in input formatters and model binders.
This is needed as validation for value types can best be done at creation time.

Followup PRs:
Introduce support for skipping validation (and not binding) for a particular property/type etc.
2015-02-17 11:50:39 -08:00