Skip to content

Commit 49bb3ef

Browse files
committed
Relay optional attributePrefix to ValidateModel()
With #2bf635e, we (re)introduced the `attributePrefix` parameter to the `ValidateModel()` method. Since `ValidateModel()` crawls the entire model's object graph, it is capable of detecting the `[AttributePrefix()]` attribute, and relaying the value to nested `ValidateModel()` calls. That said, technically, it is possible for a caller of the `IReverseTopicMappingService` to relay their own `AttributePrefix`, even if it's not otherwise defined on the model itself. To ensure that scenario is also tested, the `attributePrefix` parameter is being relayed to the `ValidateModel()` method.
1 parent 2bf635e commit 49bb3ef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

OnTopic/Mapping/Reverse/ReverseTopicMappingService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public ReverseTopicMappingService(ITopicRepository topicRepository) {
213213
var properties = _typeCache.GetMembers<PropertyInfo>(source.GetType());
214214
var contentTypeDescriptor = _contentTypeDescriptors.GetTopic(target.ContentType);
215215

216-
BindingModelValidator.ValidateModel(source.GetType(), properties, contentTypeDescriptor);
216+
BindingModelValidator.ValidateModel(source.GetType(), properties, contentTypeDescriptor, attributePrefix);
217217

218218
/*------------------------------------------------------------------------------------------------------------------------
219219
| Loop through properties, mapping each one

0 commit comments

Comments
 (0)