public static DynamicPropertyDictionaryItem ToViewModel(this DataContracts.DynamicProperties.DynamicPropertyDictionaryItem dictItem)
        {
            var retVal = new DynamicPropertyDictionaryItem();

            retVal.InjectFrom(dictItem);
            return(retVal);
        }
        private static coreDto.DynamicPropertyObjectValue ToPropertyValueDto(this DynamicPropertyDictionaryItem dictItem)
        {
            var result = new coreDto.DynamicPropertyObjectValue {
                Value = dictItem
            };

            return(result);
        }
        public static DynamicPropertyDictionaryItem ToModel(this DynamicPropertyDictionaryItemEntity entity)
        {
            var result = new DynamicPropertyDictionaryItem();

            result.InjectFrom(entity);

            result.DisplayNames = entity.DisplayNames.Select(v => v.ToModel()).ToArray();

            return(result);
        }
 private static DynamicPropertyDictionaryItem ToDictItem(this platformDto.DynamicPropertyDictionaryItem dto)
 {
     var result = new DynamicPropertyDictionaryItem();
     result.InjectFrom<NullableAndEnumValueInjecter>(dto);
     if (dto.DisplayNames != null)
     {
         result.DisplayNames = dto.DisplayNames.Select(x => new LocalizedString(new Language(x.Locale), x.Name)).ToList();
     }
     return result;
 }
예제 #5
0
        public static DynamicPropertyDictionaryItem ToWebModel(this VirtoCommercePlatformCoreDynamicPropertiesDynamicPropertyDictionaryItem dto)
        {
            var retVal = new DynamicPropertyDictionaryItem();

            retVal.InjectFrom <NullableAndEnumValueInjecter>(dto);
            if (dto.DisplayNames != null)
            {
                retVal.DisplayNames = dto.DisplayNames.Select(x => new LocalizedString(new Language(x.Locale), x.Name)).ToList();
            }
            return(retVal);
        }
        public virtual DynamicPropertyDictionaryItem ToModel(DynamicPropertyDictionaryItem dictItem)
        {
            if (dictItem == null)
            {
                throw new ArgumentNullException(nameof(dictItem));
            }

            dictItem.PropertyId   = PropertyId;
            dictItem.Name         = Name;
            dictItem.DisplayNames = DisplayNames.Select(x => x.ToModel(AbstractTypeFactory <DynamicPropertyDictionaryItemName> .TryCreateInstance())).ToArray();
            return(dictItem);
        }
        private static DynamicPropertyDictionaryItem ToDictItem(this platformDto.DynamicPropertyDictionaryItem dto)
        {
            var result = new DynamicPropertyDictionaryItem();

            result.Id         = dto.Id;
            result.Name       = dto.Name;
            result.PropertyId = dto.PropertyId;
            if (dto.DisplayNames != null)
            {
                result.DisplayNames = dto.DisplayNames.Select(x => new LocalizedString(new Language(x.Locale), x.Name)).ToList();
            }
            return(result);
        }
예제 #8
0
        public static DynamicPropertyDictionaryItem GetDynamicPropertyDictValue(this IEnumerable <DynamicProperty> properties, string propertyName)
        {
            var retVal = new DynamicPropertyDictionaryItem();

            if (properties != null)
            {
                var property = properties.FirstOrDefault(v => String.Equals(v.Name, propertyName, StringComparison.CurrentCultureIgnoreCase) && v.IsDictionary && v.Values != null);

                if (property != null)
                {
                    retVal = property.DictionaryValues.FirstOrDefault();
                }
            }
            return(retVal);
        }
        public static DynamicPropertyDictionaryItem GetDynamicPropertyDictValue(this IEnumerable<DynamicProperty> properties, string propertyName)
        {
            var retVal = new DynamicPropertyDictionaryItem();

            if (properties != null)
            {
                var property = properties.FirstOrDefault(v => String.Equals(v.Name, propertyName, StringComparison.CurrentCultureIgnoreCase) && v.IsDictionary && v.Values != null);

                if (property != null)
                {
                    retVal = property.DictionaryValues.FirstOrDefault();
                }
            }
            return retVal;
        }
예제 #10
0
        public virtual DynamicPropertyDictionaryItemEntity FromModel(DynamicPropertyDictionaryItem dictItem)
        {
            if (dictItem == null)
            {
                throw new ArgumentNullException(nameof(dictItem));
            }

            PropertyId = dictItem.PropertyId;
            Name       = dictItem.Name;
            if (dictItem.DisplayNames != null)
            {
                DisplayNames = new ObservableCollection <DynamicPropertyDictionaryItemNameEntity>(dictItem.DisplayNames.Select(x => AbstractTypeFactory <DynamicPropertyDictionaryItemNameEntity> .TryCreateInstance().FromModel(x)));
            }
            return(this);
        }
        public static DynamicPropertyDictionaryItemEntity ToEntity(this DynamicPropertyDictionaryItem model, DynamicPropertyEntity property)
        {
            var result = new DynamicPropertyDictionaryItemEntity();

            result.InjectFrom(model);

            result.PropertyId = property.Id;

            if (model.DisplayNames != null)
            {
                result.DisplayNames = new ObservableCollection <DynamicPropertyDictionaryItemNameEntity>(model.DisplayNames.Select(v => v.ToEntity()));
            }

            return(result);
        }
        public static DataContracts.DynamicProperties.DynamicPropertyDictionaryItem ToServiceModel(this DynamicPropertyDictionaryItem propertyItem)
        {
            var serviceModel = new DataContracts.DynamicProperties.DynamicPropertyDictionaryItem();

            serviceModel.InjectFrom(propertyItem);

            return(serviceModel);
        }
예제 #13
0
        public static VirtoCommercePlatformCoreDynamicPropertiesDynamicPropertyObjectValue ToServiceModelDynamicPropertyObjectValue(this DynamicPropertyDictionaryItem dictItem)
        {
            var serviceModel = new VirtoCommercePlatformCoreDynamicPropertiesDynamicPropertyObjectValue();

            serviceModel.Value = dictItem;

            return(serviceModel);
        }
        private static CartModule.Client.Model.DynamicPropertyObjectValue ToCartApiModel(this DynamicPropertyDictionaryItem dictItem)
        {
            var result = new CartModule.Client.Model.DynamicPropertyObjectValue {
                Value = dictItem
            };

            return(result);
        }