public IRdbmsStoragePropertyDefinition UnifyWithEquivalentProperties(IEnumerable <IRdbmsStoragePropertyDefinition> equivalentProperties)
        {
            ArgumentUtility.CheckNotNull("equivalentProperties", equivalentProperties);
            var checkedProperties = equivalentProperties.Select(property => StoragePropertyDefinitionUnificationUtility.CheckAndConvertEquivalentProperty(
                                                                    this, property, "equivalentProperties")).ToArray();

            var unifiedValueProperty   = _valueProperty.UnifyWithEquivalentProperties(checkedProperties.Select(p => p.ValueProperty));
            var unifiedClassIDProperty = _classIDProperty.UnifyWithEquivalentProperties(checkedProperties.Select(p => p.ClassIDProperty));

            return(new ObjectIDStoragePropertyDefinition(unifiedValueProperty, unifiedClassIDProperty));
        }
示例#2
0
        public IRdbmsStoragePropertyDefinition UnifyWithEquivalentProperties(IEnumerable <IRdbmsStoragePropertyDefinition> equivalentProperties)
        {
            ArgumentUtility.CheckNotNull("equivalentProperties", equivalentProperties);
            equivalentProperties.Select(property => StoragePropertyDefinitionUnificationUtility.CheckAndConvertEquivalentProperty(
                                            this,
                                            property,
                                            "equivalentProperties",
                                            prop => Tuple.Create <string, object> ("property type", prop.PropertyType),
                                            prop => Tuple.Create <string, object> ("message", prop.Message),
                                            prop => Tuple.Create <string, object> ("inner exception type", prop.InnerException.GetType())
                                            )).ToArray();

            return(new UnsupportedStoragePropertyDefinition(_propertyType, _message, _innerException));
        }
        public IRdbmsStoragePropertyDefinition UnifyWithEquivalentProperties(IEnumerable <IRdbmsStoragePropertyDefinition> equivalentProperties)
        {
            ArgumentUtility.CheckNotNull("equivalentProperties", equivalentProperties);
            var checkedProperties = equivalentProperties.Select(property => StoragePropertyDefinitionUnificationUtility.CheckAndConvertEquivalentProperty(
                                                                    this,
                                                                    property,
                                                                    "equivalentProperties",
                                                                    prop => Tuple.Create <string, object> ("property type", prop.PropertyType)
                                                                    )).ToArray();

            var unifiedSerializedIDProperty = _serializedIDProperty.UnifyWithEquivalentProperties(checkedProperties.Select(p => p.SerializedIDProperty));

            return(new SerializedObjectIDStoragePropertyDefinition(unifiedSerializedIDProperty));
        }
        public IRdbmsStoragePropertyDefinition UnifyWithEquivalentProperties(IEnumerable <IRdbmsStoragePropertyDefinition> equivalentProperties)
        {
            ArgumentUtility.CheckNotNull("equivalentProperties", equivalentProperties);
            var checkedProperties = equivalentProperties.Select(property => StoragePropertyDefinitionUnificationUtility.CheckAndConvertEquivalentProperty(
                                                                    this,
                                                                    property,
                                                                    "equivalentProperties",
                                                                    prop => Tuple.Create <string, object> ("property type", prop.PropertyType),
                                                                    prop => Tuple.Create <string, object> ("nested property count", prop._properties.Length)
                                                                    )).ToArray();

            return(new CompoundStoragePropertyDefinition(
                       _propertyType,
                       _properties.Select(
                           (p, i) =>
                           new NestedPropertyInfo(
                               p.StoragePropertyDefinition.UnifyWithEquivalentProperties(
                                   checkedProperties.Select(other => other._properties[i].StoragePropertyDefinition)),
                               p.ValueAccessor)),
                       _valueCombinator));
        }
        public IStorageTypeInformation UnifyForEquivalentProperties(IEnumerable <IStorageTypeInformation> equivalentStorageTypes)
        {
            ArgumentUtility.CheckNotNull("equivalentStorageTypes", equivalentStorageTypes);
            var castStorageTypes =
                equivalentStorageTypes.Select(
                    equivalentInfo =>
                    StoragePropertyDefinitionUnificationUtility.CheckAndConvertEquivalentProperty(
                        this,
                        equivalentInfo,
                        "equivalentStorageTypes",
                        info => Tuple.Create <string, object> ("storage type", info.StorageType),
                        info => Tuple.Create <string, object> ("storage type name", info.StorageTypeName),
                        info => Tuple.Create <string, object> ("storage DbType", info.StorageDbType),
                        info => Tuple.Create <string, object> (".NET type", info.DotNetType),
                        info => Tuple.Create <string, object> (".NET type converter type", info.DotNetTypeConverter.GetType())));

            return(new StorageTypeInformation(
                       _storageType,
                       _storageTypeName,
                       _storageDbType,
                       castStorageTypes.Any(x => x._isStorageTypeNullable) || _isStorageTypeNullable,
                       _dotNetType,
                       _dotNetTypeConverter));
        }