Пример #1
0
 internal static CollectionMapping CreateFrom(
     IEntityMapping entityMapping,
     ICollectionMappingProvider collectionMappingProvider,
     IConverter valueConverter,
     IEnumerable <QIriMapping> qiriMappings)
 {
     return(new CollectionMapping(
                entityMapping,
                collectionMappingProvider.Property,
                collectionMappingProvider.GetGraph(qiriMappings),
                collectionMappingProvider.GetTerm(qiriMappings),
                valueConverter,
                collectionMappingProvider.StoreAs));
 }
        private CollectionMapping BuildCollectionMapping(ICollectionMappingProvider provider)
        {
            var collectionMapping = new CollectionMapping(
                provider.PropertyInfo.DeclaringType,
                provider.PropertyInfo.PropertyType,
                provider.PropertyInfo.Name,
                provider.GetTerm(_mappingContext.OntologyProvider),
                provider.StoreAs);
            bool converterSet = SetConverter(collectionMapping, provider);
            if ((provider.ElementConverterType != null) && (!provider.ElementConverterType.ContainsGenericParameters))
            {
                collectionMapping.ElementConverter = (INodeConverter)Activator.CreateInstance(provider.ElementConverterType);
            }
            else if (converterSet)
            {
                collectionMapping.ElementConverter = collectionMapping.Converter;
            }

            return collectionMapping;
        }
Пример #3
0
        private CollectionMapping BuildCollectionMapping(ICollectionMappingProvider provider)
        {
            var collectionMapping = new CollectionMapping(
                provider.PropertyInfo.DeclaringType,
                provider.PropertyInfo.PropertyType,
                provider.PropertyInfo.Name,
                provider.GetTerm(_mappingContext.OntologyProvider),
                provider.StoreAs);
            bool converterSet = SetConverter(collectionMapping, provider);

            if ((provider.ElementConverterType != null) && (!provider.ElementConverterType.GetTypeInfo().ContainsGenericParameters))
            {
                collectionMapping.ElementConverter = _converterCatalog.GetConverter(provider.ElementConverterType);
            }
            else if (converterSet)
            {
                collectionMapping.ElementConverter = collectionMapping.Converter;
            }

            return(collectionMapping);
        }
Пример #4
0
 /// <inheritdoc />
 public Iri GetTerm(IEnumerable <QIriMapping> qiriMappings)
 {
     return(_parentCollectionMappingProvider.GetTerm(qiriMappings));
 }