Commit Graph

652 Commits

Author SHA1 Message Date
Pranav K b520b0cb22 Limit [FromServices] to apply only to parameters
Fixes #3507
2015-11-17 16:41:04 -08:00
herecydev db94a8ed19 Removed redundant null checks and tested logging 2015-11-17 15:32:54 -08:00
Ajay Bhargav Baaskaran 01102bba3f Moving Attribute Routing to Routing 2015-11-17 11:02:58 -08:00
Pranav K 292207d17d Reacting to DependencyInjection changes 2015-11-13 10:47:34 -08:00
Ajay Bhargav Baaskaran b8b222b295 Replace InnerAttributeRoute with TreeRouter 2015-11-12 15:52:51 -08:00
Cesar Blum Silveira 4a68550e50 Merge branch 'release' into dev 2015-11-11 10:59:32 -08:00
Ajay Bhargav Baaskaran f7a211c095 Removed use of LINQ and added some optimizations in ValidationVisitor 2015-11-06 11:56:52 -08:00
Kiran Challa 5364468001 [Fixes #3177] Clean up logic for encoding in ViewResult and friends 2015-11-06 10:44:09 -08:00
ryanbrandenburg cd761a644d * Adding test 2015-11-04 13:55:02 -08:00
Pranav K 940fb7ba78 Adding Controller.Challenge and Controller.Forbid 2015-11-04 09:57:19 -08:00
Cesar Blum Silveira 9dba871108 Strong name everything. 2015-11-03 21:16:49 -08:00
Ryan Nowak 32da2b8c46 Fix breaking changes from HttpAbstractions 2015-11-02 18:19:10 -08:00
Ryan Nowak e2c2676042 Add InputFormatter buffer pooling 2015-11-02 14:36:59 -08:00
Doug Bunting ff91e796c1 Revert "Fixing tests"
- wrong fix especially now that test encoders work as expected
- touch up `HtmlHelperTest` and `RazorViewTest` since test encoders are now consistent
- remove references to old `Microsoft.Extensions.WebEncoders.Testing` package

This reverts commit a9d5876cd9.
- but leave `FormTagHelperTest` and `ValidationMessageTagHelperTest` cleanup alone

nit: use `string.Empty` in `HtmlHelperLinkGenerationTest`
2015-11-02 09:45:56 -08:00
Pranav K 08be63c3fc Add ForbiddenResult
Fixes #3242
2015-10-30 10:13:58 -07:00
Ryan Nowak 1312ed8b71 Remove Linq and boxed Enumerator allocations from conneg 2015-10-29 18:40:22 -07:00
Ryan Nowak ec2abc8ae0 Add logging of elapsed time for the action. 2015-10-23 15:35:31 -07:00
Ajay Bhargav Baaskaran eb398c811d Added LocalRedirectresult
- Fixes #3346
- Added helper method in controller
- Added relevant tests
2015-10-23 12:58:41 -07:00
Ryan Nowak bcde82cf62 Use buffer pooling in IOutputFormatters 2015-10-23 08:10:30 -07:00
Pavel Krymets 4e8c543489 Rename Microsoft.Runtime.Abstractions to Microsoft.Extensions.PlatformAbstractions 2015-10-22 19:48:55 -07:00
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
Pavel Krymets 84bfb8da3b Remove CallContextServiceLocator usages in tests 2015-10-22 12:15:48 -07:00
Ryan Nowak f2af02b1cb Improve logging behavior for actions scope 2015-10-22 11:23:04 -07:00
ryanbrandenburg da731fc641 Add logging to ActionResults and ControllerActionInvoker 2015-10-21 13:16:14 -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
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 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
unknown 6a4da5d795 PhysicalFileResult throws NotSupported on path not rooted 2015-10-16 13:31:52 -07:00
Ajay Bhargav Baaskaran 6ef2fe44ca [Fixes #3250] Remove RouteGroup from RouteValues 2015-10-16 10:57:22 -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
Ryan Nowak 9342cb0ab7 Suppress [Obsolete] warnings from DiagnosticSource 2015-10-08 12:47:08 -07:00
Ryan Nowak 0dadf56fc8 Reducing allocations in value providers
- Don't go async in formdata providers unless we need to
- Remove unnecessary defensive copy in CompositeValueProvider
2015-10-06 14:25:19 -07:00
Pranav K 04d72d8894 Simplify FileResult
Fixes #3249
2015-10-06 11:26:56 -07:00
Ryan Nowak ad3c257ef5 Fix for #3252 - Issues with pooled buffer + unicode
- Dispose buffers when Flush throws inside the Dispose method
- Compute size of buffers correctly
- Throw earlier when handed invalid-sized buffers
2015-10-05 09:45:23 -07:00
Pranav K f57e180971 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:53 -07:00
Ryan Nowak 4e08eda58d Use pooled memory for the streamwriter 2015-10-02 14:35:15 -07:00
Kiran Challa eef6c3883a Renamed PhysicalFileProviderResult and VirtualFileProviderResult to PhysicalFileResult and VirtualFileResult respectively 2015-10-01 19:57:35 -07:00
Pranav K 5a705d820d Replacing NotNullAttribute with thrown exceptions 2015-10-01 08:23:21 -07:00
Pranav K 3a876e387f Replacing NotNullAttribute with thrown exceptions 2015-10-01 06:19:18 -07:00
Stefán Jökull Sigurðarson c713aa92ca Making the HtmlHelper.GetEnumSelectList take DisplayAttribute.GroupName into account to create select groups. 2015-09-29 09:53:48 -07:00
Doug Bunting 28aec3f5cc Support user overrides of system-provided `ModelError` messages
- #2969
- add `ModelBindingMessages` for configuration and `IBindingMetadataProvider` overrides
  - use `interface` to avoid `new` oddities when adding a setter to an `abstract` property
- add `IModelBindingMessages` to `ModelMetadata` for use in rest of the product code
- plumb the various bits through the system
- add integration tests using a custom `IBindingMetadataProvider`s to override messages

nits:
- remove unused resources
- use `AttemptedValue` and not `model` in `SimpleTypeModelBinder`
2015-09-28 15:50:21 -07:00
Ryan Nowak 0d6edf240a Move ModelExplorer to ViewFeatures 2015-09-28 14:14:40 -07:00
Søren Kruse ec18b35123 Add FormatterCollection<T>
#2945
2015-09-28 13:23:19 -07:00
Ryan Nowak 8a502dbe5d Rewrite of validation 2015-09-25 16:56:42 -07:00
Kirthi Krishnamraju 0889b18f95 Add localizers to validation attributes 2015-09-25 16:13:21 -07:00