@@ -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 , attributePrefix ) ;
216+ BindingModelValidator . ValidateModel ( source . GetType ( ) , properties , contentTypeDescriptor ) ;
217217
218218 /*------------------------------------------------------------------------------------------------------------------------
219219 | Loop through properties, mapping each one
@@ -262,9 +262,9 @@ protected async Task SetPropertyAsync(
262262 /*------------------------------------------------------------------------------------------------------------------------
263263 | Establish per-property variables
264264 \-----------------------------------------------------------------------------------------------------------------------*/
265- var configuration = new PropertyConfiguration ( property ) ;
265+ var configuration = new PropertyConfiguration ( property , attributePrefix ) ;
266266 var contentTypeDescriptor = _contentTypeDescriptors . GetTopic ( target . ContentType ) ;
267- var compositeAttributeKey = attributePrefix + configuration . AttributeKey ;
267+ var compositeAttributeKey = configuration . AttributeKey ;
268268
269269 Contract . Assume ( contentTypeDescriptor , nameof ( contentTypeDescriptor ) ) ;
270270
@@ -282,7 +282,7 @@ protected async Task SetPropertyAsync(
282282 await MapAsync (
283283 property . GetValue ( source ) ,
284284 target ,
285- attributePrefix + configuration . AttributePrefix
285+ configuration . AttributePrefix
286286 ) . ConfigureAwait ( false ) ;
287287 return ;
288288 }
@@ -308,16 +308,16 @@ await MapAsync(
308308 \-----------------------------------------------------------------------------------------------------------------------*/
309309 switch ( attributeType . ModelType ) {
310310 case ModelType . ScalarValue :
311- SetScalarValue ( source , target , configuration , attributePrefix ) ;
311+ SetScalarValue ( source , target , configuration ) ;
312312 return ;
313313 case ModelType . Relationship :
314- SetRelationships ( source , target , configuration , attributePrefix ) ;
314+ SetRelationships ( source , target , configuration ) ;
315315 return ;
316316 case ModelType . NestedTopic :
317- await SetNestedTopicsAsync ( source , target , configuration , attributePrefix ) . ConfigureAwait ( false ) ;
317+ await SetNestedTopicsAsync ( source , target , configuration ) . ConfigureAwait ( false ) ;
318318 return ;
319319 case ModelType . Reference :
320- SetReference ( source , target , configuration , attributePrefix ) ;
320+ SetReference ( source , target , configuration ) ;
321321 return ;
322322 }
323323
@@ -332,7 +332,7 @@ await MapAsync(
332332 /// <remarks>
333333 /// Assuming the <paramref name="configuration"/>'s <see cref="PropertyConfiguration.Property"/> is of the type <see
334334 /// cref="String"/>, <see cref="Boolean"/>, <see cref="Int32"/>, or <see cref="DateTime"/>, the <see
335- /// cref="SetScalarValue(Object, Topic, PropertyConfiguration, String )"/> method will attempt to set the property on the
335+ /// cref="SetScalarValue(Object, Topic, PropertyConfiguration)"/> method will attempt to set the property on the
336336 /// <paramref name="target"/>. If the value is not set on the <paramref name="source"/> then the <see
337337 /// cref="DefaultValueAttribute"/> will be evaluated as a fallback. If the property is not of a settable type then the
338338 /// property is not set. If the value is empty, then it will be treated as <c>null</c> in the <paramref name="target"/>'s
@@ -343,13 +343,11 @@ await MapAsync(
343343 /// </param>
344344 /// <param name="target">The <see cref="Topic"/> entity to map the data to.</param>
345345 /// <param name="configuration">The <see cref="PropertyConfiguration"/> with details about the property's attributes.</param>
346- /// <param name="attributePrefix">The prefix to apply to the attributes.</param>
347346 /// <autogeneratedoc />
348347 protected static void SetScalarValue (
349348 object source ,
350349 Topic target ,
351- PropertyConfiguration configuration ,
352- string ? attributePrefix = null
350+ PropertyConfiguration configuration
353351 )
354352 {
355353
@@ -386,7 +384,7 @@ protected static void SetScalarValue(
386384 /*------------------------------------------------------------------------------------------------------------------------
387385 | Set the value (to null, if appropriate)
388386 \-----------------------------------------------------------------------------------------------------------------------*/
389- target . Attributes . SetValue ( attributePrefix + configuration . AttributeKey , attributeValue ) ;
387+ target . Attributes . SetValue ( configuration . AttributeKey , attributeValue ) ;
390388
391389 }
392390
@@ -404,12 +402,10 @@ protected static void SetScalarValue(
404402 /// <param name="configuration">
405403 /// The <see cref="PropertyConfiguration"/> with details about the property's attributes.
406404 /// </param>
407- /// <param name="attributePrefix">The prefix to apply to the attributes.</param>
408405 protected void SetRelationships (
409406 object source ,
410407 Topic target ,
411- PropertyConfiguration configuration ,
412- string ? attributePrefix = null
408+ PropertyConfiguration configuration
413409 )
414410 {
415411
@@ -432,7 +428,7 @@ protected void SetRelationships(
432428 /*------------------------------------------------------------------------------------------------------------------------
433429 | Clear existing relationships
434430 \-----------------------------------------------------------------------------------------------------------------------*/
435- target . Relationships . ClearTopics ( attributePrefix + configuration . AttributeKey ) ;
431+ target . Relationships . ClearTopics ( configuration . AttributeKey ) ;
436432
437433 /*------------------------------------------------------------------------------------------------------------------------
438434 | Set relationships for each
@@ -446,7 +442,7 @@ protected void SetRelationships(
446442 $ "be located in the repository."
447443 ) ;
448444 }
449- target . Relationships . SetTopic ( attributePrefix + configuration . AttributeKey , targetTopic ) ;
445+ target . Relationships . SetTopic ( configuration . AttributeKey , targetTopic ) ;
450446 }
451447
452448 }
@@ -465,12 +461,10 @@ protected void SetRelationships(
465461 /// <param name="configuration">
466462 /// The <see cref="PropertyConfiguration"/> with details about the property's attributes.
467463 /// </param>
468- /// <param name="attributePrefix">The prefix to apply to the attributes.</param>
469464 protected async Task SetNestedTopicsAsync (
470465 object source ,
471466 Topic target ,
472- PropertyConfiguration configuration ,
473- string ? attributePrefix = null
467+ PropertyConfiguration configuration
474468 ) {
475469
476470 /*------------------------------------------------------------------------------------------------------------------------
@@ -488,9 +482,9 @@ protected async Task SetNestedTopicsAsync(
488482 /*------------------------------------------------------------------------------------------------------------------------
489483 | Establish target collection to store mapped topics
490484 \-----------------------------------------------------------------------------------------------------------------------*/
491- var container = target . Children . GetTopic ( attributePrefix + configuration . AttributeKey ) ;
485+ var container = target . Children . GetTopic ( configuration . AttributeKey ) ;
492486 if ( container == null ) {
493- container = TopicFactory . Create ( attributePrefix + configuration . AttributeKey , "List" , target ) ;
487+ container = TopicFactory . Create ( configuration . AttributeKey , "List" , target ) ;
494488 container . IsHidden = true ;
495489 }
496490
@@ -515,12 +509,10 @@ protected async Task SetNestedTopicsAsync(
515509 /// <param name="configuration">
516510 /// The <see cref="PropertyConfiguration"/> with details about the property's attributes.
517511 /// </param>
518- /// <param name="attributePrefix">The prefix to apply to the attributes.</param>
519512 protected void SetReference (
520513 object source ,
521514 Topic target ,
522- PropertyConfiguration configuration ,
523- string ? attributePrefix = null
515+ PropertyConfiguration configuration
524516 ) {
525517
526518 /*------------------------------------------------------------------------------------------------------------------------
@@ -560,7 +552,7 @@ protected void SetReference(
560552 /*------------------------------------------------------------------------------------------------------------------------
561553 | Set target attribute
562554 \-----------------------------------------------------------------------------------------------------------------------*/
563- target . Attributes . SetInteger ( attributePrefix + configuration . AttributeKey , topicReference . Id ) ;
555+ target . Attributes . SetInteger ( configuration . AttributeKey , topicReference . Id ) ;
564556
565557 }
566558
0 commit comments