AutoMapper.TypeMap.FindOrCreatePropertyMapFor C# (CSharp) Метод

FindOrCreatePropertyMapFor() публичный Метод

public FindOrCreatePropertyMapFor ( IMemberAccessor destinationProperty ) : PropertyMap
destinationProperty IMemberAccessor
Результат PropertyMap
        public PropertyMap FindOrCreatePropertyMapFor(IMemberAccessor destinationProperty)
        {
            var propertyMap = GetExistingPropertyMapFor(destinationProperty);

            if (propertyMap != null) return propertyMap;

            propertyMap = new PropertyMap(destinationProperty, this);

            _propertyMaps.Add(propertyMap);

            return propertyMap;
        }

Usage Example

Пример #1
0
        private void ForDestinationMember(IMemberAccessor destinationProperty, Action <IMemberConfigurationExpression> memberOptions)
        {
            _propertyMap = _typeMap.FindOrCreatePropertyMapFor(destinationProperty);

            memberOptions(this);
        }