public void MapPropertiesToObject( object obj, IAbstractService service, AbstractTypeCreationContext context)
{
try
{
//create properties
AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj);
for (int i = Properties.Length - 1; i >= 0; i--)
{
var prop = Properties[i];
try
{
prop.Mapper.MapCmsToProperty(dataMappingContext);
}
catch (MapperStackException)
{
throw;
}
catch (Exception e)
{
throw new MapperException(
"Failed to map property {0} on {1}".Formatted(prop.PropertyInfo.Name,
prop.PropertyInfo.DeclaringType.FullName), e);
}
}
}
catch (MapperStackException)
{
throw;
}
catch (Exception ex)
{
throw new MapperException(
"Failed to map properties on {0}.".Formatted(context.DataSummary()), ex);
}
}