Commit Graph

2007 Commits

Author SHA1 Message Date
N. Taylor Mullen 405d105bd7 Update NuGet feed from v2 => v3. 2015-08-19 14:55:23 -07:00
N. Taylor Mullen b871172dd0 Expose locations of `_ViewImports.cshtml` that affect a given Razor file.
- Added `ChunkTreeResult` to associate inherited chunks with a specific source file.
- Updated existing tests to validate file path.

#2256
2015-08-19 12:12:52 -07:00
David Fowler 91c0081939 Added reference to Microsoft.AspNet.Mvc.Razor so that it's loadable. 2015-08-19 10:24:29 -07:00
David Fowler 485e6e5ee8 React to dnx refactoring changes
- Use compilation options from the Compilation itself
- Get the parse options from the first syntax tree
- Get the build time IAssemblyLoadContext directly
2015-08-19 03:04:10 -07:00
Pranav K a0879cc37f Updating to aspnetlitedev. 2015-08-18 14:00:28 -07:00
Pranav K 8d75aa3e14 Merge branch 'release' into dev 2015-08-18 14:00:28 -07:00
Pranav K f116b91750 Updating to aspnetliterelease. 2015-08-18 14:00:28 -07:00
Doug Bunting f10a071da3 Preserve `ViewDataDictionary.ModelType` for `Nullable<T>` properties when `Model` is non-`null`
- #2539
- reuse `ModelMetadata` and occasionally `ModelExplorer` when `ModelType` is `Nullable<T>`
2015-08-18 10:33:40 -07:00
Doug Bunting c2347e4d4b Merge branch 'release' into dev 2015-08-18 10:30:04 -07:00
Doug Bunting 48f09d0e8d Do not trounce existing property values that are not bound in `TryUpdateModel` scenarios
- #2836

Part 1: Use existing property values when recursing in `MutableObjectModelBinder`
- remove `ComplexModelDTO` because that indirection made fixing this issue more difficult and doesn't add value
  - started with an old closed PR (#2241) which did some of this work
- correct `MutableObjectModelBinderTest` tests that exercised behaviour that can't occur
  - the old `dto.Results` dictionary was never incomplete; nor could it contain `null` values

Part 2: Change `MutableObjectModelBinder` to pass complex property values into binding system
- model binding no longer trounces nodes in the model tree that aren't bound
- create model instances less often in `TryUpdateModel` scenarios
  - refactor `EnsureModel()` to `GetModel()` and use appropriately
- reorder logic in `SetProperty()` and `AddToProperty()` to avoid copying to / from the same collection
  - also cleans up some code duplication

nits:
- clean up `MutableObjectModelBinderTest`
  - fix odd line wrappings and indentation
  - use `nameof()` more
  - use `string.Empty` more
  - simplify a couple of `Returns()` expressions
- make assertions in `TryUpdateModelIntegrationTest` more readable
  - no need to work through `ModelStateDictionary.Keys`
  - also use `Length` instead of `Count()`; test code but we don't need Linq at all in that test class
2015-08-18 09:57:41 -07:00
Pranav K 7085e8ab4d Merge branch 'release' into dev 2015-08-17 14:49:37 -07:00
Pranav K 459b271a44 Updating to release NuGet.config. 2015-08-17 14:49:34 -07:00
Ryan Nowak 9d89a8cac3 Homogenize MVC startup code patterns
Use builder APIS for both AddMvc() and AddMvcCore()
Change various API patterns to all use .AddXyz(...) off of one or both of
these builders.
2015-08-16 18:48:24 -07:00
Ajay Bhargav Baaskaran dac75fa56d React to aspnet/Razor#441 change 2015-08-16 18:22:22 -07:00
Ryan Nowak e384938425 Add more event notification data points
Also includes some cleanup of the testing code that we're using with
proxies.
2015-08-16 16:42:58 -07:00
Ryan Nowak 07fabde92a Part 3 of #2776 - revert a6ce9abab1 and add
some more tests.

This change reverts the behavior change from
a6ce9abab1 and adds more tests around the
scneario that was actually broken.

The right behavior is that unconvertable values result in a validation
error. There's no special behavior around value types and required values.
2015-08-16 16:20:44 -07:00
sornaks 27f7f3d437 Issue #2779 - Normalize newlines to "\r\n" instead of "\n". 2015-08-14 17:13:29 -07:00
N. Taylor Mullen e73e73acdd Add `srcset` to list of application relative resolvable URLs.
- Now allow the attribute to exist on `img` and `source` tags.
- Updated existing `UrlResolutionTagHelper` functional test to validate `srcset` attribute.

#2964
2015-08-14 15:58:02 -07:00
Troy Dai 82dced7877 Remove Roslyn feed 2015-08-14 15:50:12 -07:00
Ajay Bhargav Baaskaran 6fe5045c55 React to aspnet/Razor#488 2015-08-14 13:00:39 -07:00
sornaks f2540f9ba1 Making TagBuilder implement IHtmlContent and removing ToHtmlContent.
- Making TagRenderMode a property in TagBuilder.
- Modifying places where TagBuilder is used to suit the new model.
- This reduces space occupied by a normal application by 11.8%.
2015-08-14 10:58:51 -07:00
Pranav K 93d07147b2 ViewViewComponentResult doesn't handle `~/` in view paths correctly
Fixes #2856
2015-08-14 09:53:36 -07:00
Kirthi Krishnamraju 18c3ad25fb fix build break due to aspnet/configuration #246 2015-08-13 23:19:56 -07:00
Ajay Bhargav Baaskaran 4295a57504 [Fixes #2817] Support client side validation for all numeric types 2015-08-13 17:32:13 -07:00
Ryan Nowak 7aa5967cd4 Fix #2859 - Correct UrlHelper for special tokens
This change restores a link generation behavior from MVC5 and earlier
where 'action' and 'controller' values are special cased-when using
Url.Action(...).

The change is that in-effect 'action' and 'controller' are always included
in the route values given to the routing system. Passing a null value into
the Url.Action(...) method means that the ambient value for that token
should be used explicitly. This means that the 'action' and 'controller'
tokens become sticky, even when something to the lexical left in the URL
(like area) changes.
2015-08-13 17:04:21 -07:00
N. Taylor Mullen 21d96eb16a Enabled `LinkTagHelper` to be written in the void format.
- Updated existing tests to showcase it can be written as just the start tag.
2015-08-13 16:19:30 -07:00
N. Taylor Mullen e1572f98ce Added `InputTagHelper` `TagRenderingMode` modificaitons to react to `output.TagMode`. 2015-08-13 16:19:29 -07:00
N. Taylor Mullen 1b51f6bca6 Enable input, image and url resolution `TagHelper`s to be written as void elements.
- Razor rendering now understands `TagMode` which allows void elements to be rendered.
- Added a `TagStructure.WithoutEnd` bit to `InputTagHelper`, `ImageTagHelper` and `UrlResolutionTagHelper`. This will allow users to write the various elements in the void format. Used the HTML5 spec to determine the elements appropriate.
- Added tests to ensure `TagMode.StartTagOnly` is rendered properly.
- Updated a few functional tests to showcase the void element formats.

aspnet/Razor#450
2015-08-13 16:19:28 -07:00
Ryan Nowak 89a8d0e36c Remove IScopedInstance - use AsyncLocal for ActionContext and
ActionBindingContext

This change replaces IScopedInstance<T> in favor or IActionContextAccessor
and IActionBindingContextAccessor. In the spirit of IHttpContextAccessor,
these are both singletons which use AsyncLocal for storage.

This change allows the invoker factory to be cached which results in some
significant perf gains.
2015-08-13 15:58:29 -07:00
Ajay Bhargav Baaskaran ecfbdf2ae1 React to aspnet/Razor#428 2015-08-13 15:48:16 -07:00
Ryan Nowak a6ce9abab1 Fix #2776 - Add implicit [BindRequired] for value type properties 2015-08-13 15:35:54 -07:00
Pranav K 3558c1d979 Reacting to Logging changes 2015-08-13 11:22:28 -07:00
Pranav K 9a5ebf1497 Use NonDisposableStream instead of using MemoryStream.ToArray() 2015-08-13 11:16:21 -07:00
Alxandr 39ab9badde Make sure references are readable multiple times 2015-08-13 11:16:20 -07:00
Pranav K c631d533c4 * Refactoring RazorFileInfoCollectionGenerator to not be instantiated.
* Adding CompilerGeneratedAttribute to generated code.
* Adding unit tests for RazorFileInfoCollectionGenerator.
2015-08-13 11:15:46 -07:00
anurse 1723ef0e97 react to IHttpContextAccessor move 2015-08-12 19:07:24 -07:00
Andrew Stanton-Nurse 3c322b4a06 react to DNX renames 2015-08-12 15:12:36 -07:00
Kiran Challa 36a239bfb5 Enable pinning build script 2015-08-11 16:52:20 -07:00
Stephen Halter 43064ef8b6 React to Kestrel rename
aspnet/KestrelHttpServer#11
2015-08-11 16:30:03 -07:00
Ryan Nowak 12ceb6ae1c React to DI namespace change part 3. 2015-08-11 15:44:47 -07:00
Ryan Nowak a1a6be06b6 React to namespace change in DI part 2. 2015-08-11 14:30:07 -07:00
Ryan Nowak f7cea9b6d7 React to namespace change in DI. 2015-08-11 14:10:30 -07:00
Ryan Nowak 3ad3f88d69 Fix MVC build break due to deleted package 2015-08-11 12:21:01 -07:00
Chris R 77865ca314 #2939 React to CoreCLR Cryptography package changes. 2015-08-11 11:00:14 -07:00
Doug Bunting 9fc3d25bfc Fix build break: Missing a recently-added parameter 2015-08-11 09:03:51 -07:00
Doug Bunting 83a559c28c Add `ModelValidationNode`s consistently
- #2633
- do not leave `ModelBindingResult.ValidationNode` as `null` when we hit the `null` `RawValue` special case
 - move two bits of code together to make the special case more obvious
- add `ModelValidationNode` (that suppresses validation) when `HttpRequestMessageModelBinder` is successful
 - also suppress validation of `HttpRequestMEssage` properties
- suppress validation in `CancellationTokenModelBinder`, `FormCollectionModelBinder`, `FormCollectionModelBinder`
- do not create a `ModelValidationNode` when validation fails in `TypeConverterModelBinder`

nits:
- improve some doc comments
- add a quick `HttpRequestMessageModelBinderTest`
2015-08-11 08:30:29 -07:00
Doug Bunting d45e2ee3f5 Handle broader range of collection types in model binding
- #2793
- add `ICollectionModelBinder`, allowing `GenericModelBinder` to call `CreateEmptyCollection()`
- adjust `CollectionModelBinder` and `DictionaryModelBinder` to activate model if default types are incompatible
 - do not create default (empty) top-level collection in fallback case if Model already non-`null`
- change type checks in `GenericModelBinder` to align with `CollectionModelBinder` capabilities
 - add special case for `IEnumerable<T>`
- correct `ModelMetadata` of a few tests that previously did not need that information
2015-08-11 08:26:49 -07:00
sornaks b6a109e2a3 Making DefaultDisplayTemplates and DefaultEditorTemplates use IHtmlContent.
- Making TagBuilder's InnerHtml an IHtmlContent.
- Delay encoding until the content is written.
- Moving BufferedHtmlContent to Common cos it is used in aspnet/Razor also.
- Changing GenerateOption to take in a string and create StringHtmlContent.
- This reduces the space used by around 13%.
2015-08-10 14:55:34 -07:00
N. Taylor Mullen a0da6ec19f Add `AddHtmlAttributeValues` for `TagHelper`s.
- Refactored `WriteAttributeTo` to allow re-use of some of the core attribute writing logic. The refactoring was based on removing the `Begin`/`EndContext` for instrumentation bits which isn't valid in a `TagHelper` attribute scenario.
- Added unit tests to validate attributes are properly added to `TagHelperExecutionContext`.
- Added functional test to validate everything is output as expected with dynamic attributes (encoded and non-encoded).

aspnet/Razor#247
2015-08-10 12:06:02 -07:00
Ryan Nowak ff6cbfd7cf Make saving TempData operate via a filter
This change moves the responsibility for saving TempData into a filter,
which is registered with other View features. This moves TempData into the
ViewFeatures package.

ActionResults which require TempData to be kept use a new marker interface
which is handled by the filter.
2015-08-07 16:53:11 -07:00