9 instantiations of ModelAttribute
Microsoft.AspNetCore.Mvc.Core.Test (9)
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (9)
438
[
Model
("OnType")]
441
[
Model
("OnProperty")]
448
[
Model
("ParamAttrib1"),
Model
("ParamAttrib2")] object paramWithTwoAttributes)
453
[
Model
("OnPropertyType")]
476
private void GetMetadataForParameterTestMethod([
Model
("OnParameter")] ModelType parameter)
490
[
Model
("OnDerivedType")]
493
[
Model
("OnDerivedProperty")]
499
[
Model
("OnProperty")]
24 references to ModelAttribute
Microsoft.AspNetCore.Mvc.Core.Test (24)
ModelBinding\Metadata\DefaultModelMetadataProviderTest.cs (24)
23
var
attribute = Assert.IsType<
ModelAttribute
>(Assert.Single(defaultMetadata.Attributes.Attributes));
164
Assert.Equal("OnProperty", Assert.IsType<
ModelAttribute
>(attributes[0]).Value);
165
Assert.Equal("OnPropertyType", Assert.IsType<
ModelAttribute
>(attributes[1]).Value);
237
var
modelAttribute = Assert.IsType<
ModelAttribute
>(attribute);
242
var
modelAttribute = Assert.IsType<
ModelAttribute
>(attribute);
284
a => Assert.Equal("OnParameter", Assert.IsType<
ModelAttribute
>(a).Value),
285
a => Assert.Equal("OnDerivedType", Assert.IsType<
ModelAttribute
>(a).Value),
286
a => Assert.Equal("OnType", Assert.IsType<
ModelAttribute
>(a).Value));
296
defaultPropertyMetadata.Attributes.Attributes.OfType<
ModelAttribute
>(),
297
a => Assert.Equal("OnDerivedProperty", Assert.IsType<
ModelAttribute
>(a).Value));
305
defaultPropertyMetadata.Attributes.Attributes.OfType<
ModelAttribute
>(),
306
a => Assert.Equal("OnProperty", Assert.IsType<
ModelAttribute
>(a).Value),
307
a => Assert.Equal("OnPropertyType", Assert.IsType<
ModelAttribute
>(a).Value));
368
a => Assert.Equal("OnProperty", Assert.IsType<
ModelAttribute
>(a).Value),
369
a => Assert.Equal("OnDerivedType", Assert.IsType<
ModelAttribute
>(a).Value),
370
a => Assert.Equal("OnType", Assert.IsType<
ModelAttribute
>(a).Value));
380
defaultPropertyMetadata.Attributes.Attributes.OfType<
ModelAttribute
>(),
381
a => Assert.Equal("OnDerivedProperty", Assert.IsType<
ModelAttribute
>(a).Value));
389
defaultPropertyMetadata.Attributes.Attributes.OfType<
ModelAttribute
>(),
390
a => Assert.Equal("OnProperty", Assert.IsType<
ModelAttribute
>(a).Value),
391
a => Assert.Equal("OnPropertyType", Assert.IsType<
ModelAttribute
>(a).Value));