Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: Make the container instance available to ModelMetadataProviders [731]

$
0
0
The AssociatedModelMetadataProvider exposes the CreateMetadata signature below:

CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName)

Since we only have access to the container type, the only way to obtain the container instance (e.g. the Model in Model.Foo) is using the following hack:

var target = modelAccessor.Target;
var formMetadata = target.GetType().GetField("container").GetValue(target) as Container;



Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>