Commit Graph

18 Commits

Author SHA1 Message Date
Alexej Timonin d4beab5d09
CompositeValidationAttribute
- Add abstract CompositeValidationAttribute.
- Change DataAnnotationsMetadataProvider.CreateValidationMetadata to
populate ValidatorMetadata with validation attributes from CompositeValidationAttribute.
2018-07-20 15:31:14 -07:00
Pranav K 60a9810268 Allow PartialTagHelper to specify a null model. Fixes #7667 2018-04-18 14:16:44 -07:00
Pranav K b30020a655 PartialTagHelper should not fallback to the current page's model if asp-for expression exists
Fixes #7295
2018-01-25 11:06:40 -08:00
Pranav K e6c716444d Add a <partial /> tag helper
Fixes #5916
2017-11-30 17:08:47 -08:00
Ryan Nowak a23307e2b1 Check for properties that can't befound
If you give ModelExpressionProvider a lambda with a private property
you'll end up here. This wasn't common before, but it seems like users
are more likely to try it with pages.

Model Metadata and Model Binding don't handle private properties, so
supporting it in Model Expressions seems less than useful.

This isn't a breaking change because this case would have resulted in a
null-ref. Addresses #6400
2017-07-04 13:26:17 -07:00
Doug Bunting 1672820e4e Add functional test covering an `IList<T>` property
- #5656
2017-03-29 12:32:06 -07:00
Ryan Brandenburg 8f8bf5af34 Seperate view and model for enum display 2016-11-30 11:13:38 -08: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
N. Taylor Mullen 3be7fbdf9f Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:18:33 -08:00
Pranav K 56c6975a21 Tweak CacheTagHelper sample to use a token provider service for
cache expiration.

Fixes #3573
2015-12-11 15:23:34 -08:00
Pranav K b520b0cb22 Limit [FromServices] to apply only to parameters
Fixes #3507
2015-11-17 16:41:04 -08:00
Ajay Bhargav Baaskaran 9c81b95d1b Renamed Controller.Context to Controller.HttpContext
- #3165
2015-09-25 11:01:30 -07:00
Ryan Nowak 229724c4ea Reorganize MVC namespaces 2015-09-01 22:28:33 -07:00
Ajay Bhargav Baaskaran e4049c07eb Razor boolean and null attribute special case handled correctly
- Issue #2769
 - Special case is only applied to null and bool value with no surrounding
   whitespace
2015-07-30 10:37:38 -07:00
Ajay Bhargav Baaskaran 92f3e21fe6 Fix: Metadata ignored for non model-specific EditorTemplate
Issue - #2778
2015-07-16 15:48:01 -07:00
Doug Bunting 27283ec098 Make `string`-based expression evaluations behave consistently
- #1485, #1487
 - handle `TemplateInfo.HtmlFieldPrefix` in `ViewDataEvaluator.Eval()`
  - attempt lookup in the `ViewDataDictionary` using full name then evaluate
    relative `expression` against `viewData.Model`
  - handle `null` or empty `expression` special case in this method (remove `throw`s)
 - always pass relative `expression` name into `Eval()`
  - remove `null` or empty `expression` handling from higher-level code
  - in a couple of cases, special-case returned `ViewDataInfo`
- #2662
 - remove incorrect guard from `DefaultHtmlGenerator.GenerateRadioButtion()`
- add doc comments for the core methods that have changed
- enable unit tests skipped due to one of above bugs
 - fix one (yeah, just one) other test with incorrect expectations
- remove functional test comments about the above bugs and update expectations

nits:
- move some comments describing `ViewDataEvaluator` methods above the methods
2015-06-16 21:54:56 -07:00
Doug Bunting afd5b4f2a6 Demonstrate #1485, #1487, #2662, #2664 in functional and unit tests
- test additional cases _close_ to these bugs as well

for #1485
- show odd `@Html.CheckBox()`, `@Html.Hidden()` behaviour in unit tests
- show odd `@Html.TextBox()` behaviour in functional tests (templates)

for #1487
- show odd `@Html.Value()` behaviour in unit tests
- show odd `@Html.RadioButton()`, `@Html.TextArea()` behaviour in functional tests
- show lack of validation attributes for `@Html.RadioButton()`, `<select>` tag helper

for #2662
- show odd `@Html.RadioButton(string.Empty)` behaviour in functional tests

for #2664
- show failures with `@Html.ListBox()` in unit tests

nits:
- test `IHtmlHelper` methods, not extensions
- use `ViewData`, not `ViewBag` in `HtmlGeneration_FormController`
- name test methods a bit more consistently
- rename `HtmlHelperValueExtensionsTest` to `HtmlHelperValueTest`
2015-06-10 10:22:40 -07:00
Doug Bunting 261975b0bc Rename `MvcTagHelpersWebSite` to `HtmlGenerationsWebSite`
- name was too specific and I am about to add another HTML helper scenario
2015-06-05 20:30:17 -07:00