Example #1
0
        public bool Equals(ManyToManyAssociationMappingConfiguration other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (!Equals(other._tableName, _tableName))
            {
                return(false);
            }

            if (_leftKeyColumnNames.SequenceEqual(other._leftKeyColumnNames) &&
                _rightKeyColumnNames.SequenceEqual(other._rightKeyColumnNames))
            {
                return(true);
            }

            if (_leftKeyColumnNames.SequenceEqual(other._rightKeyColumnNames) &&
                _rightKeyColumnNames.SequenceEqual(other._leftKeyColumnNames))
            {
                return(true);
            }

            return(false);
        }
        private ManyToManyAssociationMappingConfiguration(ManyToManyAssociationMappingConfiguration source)
        {
            DebugCheck.NotNull(source);

            _leftKeyColumnNames.AddRange(source._leftKeyColumnNames);
            _rightKeyColumnNames.AddRange(source._rightKeyColumnNames);
            _tableName = source._tableName;
        }
        private ManyToManyAssociationMappingConfiguration(ManyToManyAssociationMappingConfiguration source)
        {
            DebugCheck.NotNull(source);

            _leftKeyColumnNames.AddRange(source._leftKeyColumnNames);
            _rightKeyColumnNames.AddRange(source._rightKeyColumnNames);
            _tableName = source._tableName;
        }
        private ManyToManyAssociationMappingConfiguration(ManyToManyAssociationMappingConfiguration source)
        {
            Contract.Requires(source != null);

            _leftKeyColumnNames.AddRange(source._leftKeyColumnNames);
            _rightKeyColumnNames.AddRange(source._rightKeyColumnNames);
            _tableName = source._tableName;
        }
        /// <summary>
        ///     Configures the foreign key column(s) and table used to store the relationship.
        /// </summary>
        /// <param name = "configurationAction">Action that configures the foreign key column(s) and table.</param>
        public void Map(Action<ManyToManyAssociationMappingConfiguration> configurationAction)
        {
            Contract.Requires(configurationAction != null);

            var manyToManyMappingConfiguration = new ManyToManyAssociationMappingConfiguration();

            configurationAction(manyToManyMappingConfiguration);

            _navigationPropertyConfiguration.AssociationMappingConfiguration = manyToManyMappingConfiguration;
        }
        /// <summary>
        ///     Configures the foreign key column(s) and table used to store the relationship.
        /// </summary>
        /// <param name="configurationAction"> Action that configures the foreign key column(s) and table. </param>
        public void Map(Action<ManyToManyAssociationMappingConfiguration> configurationAction)
        {
            Check.NotNull(configurationAction, "configurationAction");

            var manyToManyMappingConfiguration = new ManyToManyAssociationMappingConfiguration();

            configurationAction(manyToManyMappingConfiguration);

            _navigationPropertyConfiguration.AssociationMappingConfiguration = manyToManyMappingConfiguration;
        }
        /// <summary>
        ///     Configures the foreign key column(s) and table used to store the relationship.
        /// </summary>
        /// <param name="configurationAction"> Action that configures the foreign key column(s) and table. </param>
        public void Map(Action <ManyToManyAssociationMappingConfiguration> configurationAction)
        {
            Check.NotNull(configurationAction, "configurationAction");

            var manyToManyMappingConfiguration = new ManyToManyAssociationMappingConfiguration();

            configurationAction(manyToManyMappingConfiguration);

            _navigationPropertyConfiguration.AssociationMappingConfiguration = manyToManyMappingConfiguration;
        }
Example #8
0
        /// <summary>
        /// Configures the foreign key column(s) and table used to store the relationship.
        /// </summary>
        /// <param name="configurationAction"> Action that configures the foreign key column(s) and table. </param>
        /// <returns>The same <see cref="T:System.Data.Entity.ModelConfiguration.Configuration.ManyToManyNavigationPropertyConfiguration`2" /> instance so that multiple calls can be chained.</returns>
        public ManyToManyNavigationPropertyConfiguration <TEntityType, TTargetEntityType> Map(
            Action <ManyToManyAssociationMappingConfiguration> configurationAction)
        {
            Check.NotNull <Action <ManyToManyAssociationMappingConfiguration> >(configurationAction, nameof(configurationAction));
            ManyToManyAssociationMappingConfiguration mappingConfiguration = new ManyToManyAssociationMappingConfiguration();

            configurationAction(mappingConfiguration);
            this._navigationPropertyConfiguration.AssociationMappingConfiguration = (AssociationMappingConfiguration)mappingConfiguration;
            return(this);
        }
Example #9
0
 private ManyToManyAssociationMappingConfiguration(
     ManyToManyAssociationMappingConfiguration source)
 {
     this._leftKeyColumnNames.AddRange((IEnumerable <string>)source._leftKeyColumnNames);
     this._rightKeyColumnNames.AddRange((IEnumerable <string>)source._rightKeyColumnNames);
     this._tableName = source._tableName;
     foreach (KeyValuePair <string, object> annotation in (IEnumerable <KeyValuePair <string, object> >)source._annotations)
     {
         this._annotations.Add(annotation);
     }
 }
        private ManyToManyAssociationMappingConfiguration(ManyToManyAssociationMappingConfiguration source)
        {
            DebugCheck.NotNull(source);

            _leftKeyColumnNames.AddRange(source._leftKeyColumnNames);
            _rightKeyColumnNames.AddRange(source._rightKeyColumnNames);
            _tableName = source._tableName;

            foreach (var annotation in source._annotations)
            {
                _annotations.Add(annotation);
            }
        }
Example #11
0
        private ManyToManyAssociationMappingConfiguration(ManyToManyAssociationMappingConfiguration source)
        {
            DebugCheck.NotNull(source);

            _leftKeyColumnNames.AddRange(source._leftKeyColumnNames);
            _rightKeyColumnNames.AddRange(source._rightKeyColumnNames);
            _tableName = source._tableName;

            foreach (var annotation in source._annotations)
            {
                _annotations.Add(annotation);
            }
        }
Example #12
0
        /// <summary>
        ///     Configures the foreign key column(s) and table used to store the relationship.
        /// </summary>
        /// <param name="configurationAction"> Action that configures the foreign key column(s) and table. </param>
        public ManyToManyNavigationPropertyConfiguration <TEntityType, TTargetEntityType> Map(
            Action <ManyToManyAssociationMappingConfiguration> configurationAction)
        {
            Check.NotNull(configurationAction, "configurationAction");

            var manyToManyMappingConfiguration = new ManyToManyAssociationMappingConfiguration();

            configurationAction(manyToManyMappingConfiguration);

            _navigationPropertyConfiguration.AssociationMappingConfiguration = manyToManyMappingConfiguration;

            return(this);
        }
Example #13
0
 public bool Equals(ManyToManyAssociationMappingConfiguration other)
 {
     if (object.ReferenceEquals((object)null, (object)other))
     {
         return(false);
     }
     if (object.ReferenceEquals((object)this, (object)other))
     {
         return(true);
     }
     if (!object.Equals((object)other._tableName, (object)this._tableName) || !object.Equals((object)other._tableName, (object)this._tableName) || (!this._leftKeyColumnNames.SequenceEqual <string>((IEnumerable <string>)other._leftKeyColumnNames) || !this._rightKeyColumnNames.SequenceEqual <string>((IEnumerable <string>)other._rightKeyColumnNames)) && (!this._leftKeyColumnNames.SequenceEqual <string>((IEnumerable <string>)other._rightKeyColumnNames) || !this._rightKeyColumnNames.SequenceEqual <string>((IEnumerable <string>)other._leftKeyColumnNames)))
     {
         return(false);
     }
     return(this._annotations.OrderBy <KeyValuePair <string, object>, string>((Func <KeyValuePair <string, object>, string>)(a => a.Key)).SequenceEqual <KeyValuePair <string, object> >((IEnumerable <KeyValuePair <string, object> >)other._annotations.OrderBy <KeyValuePair <string, object>, string>((Func <KeyValuePair <string, object>, string>)(a => a.Key))));
 }
Example #14
0
        internal override void Configure(
            AssociationSetMapping associationSetMapping,
            EdmModel database,
            PropertyInfo navigationProperty)
        {
            EntityType table = associationSetMapping.Table;

            if (this._tableName != null)
            {
                table.SetTableName(this._tableName);
                table.SetConfiguration((object)this);
            }
            bool flag = navigationProperty.IsSameAs(associationSetMapping.SourceEndMapping.AssociationEnd.GetClrPropertyInfo());

            ManyToManyAssociationMappingConfiguration.ConfigureColumnNames(flag ? (ICollection <string>) this._leftKeyColumnNames : (ICollection <string>) this._rightKeyColumnNames, (IList <ScalarPropertyMapping>)associationSetMapping.SourceEndMapping.PropertyMappings.ToList <ScalarPropertyMapping>());
            ManyToManyAssociationMappingConfiguration.ConfigureColumnNames(flag ? (ICollection <string>) this._rightKeyColumnNames : (ICollection <string>) this._leftKeyColumnNames, (IList <ScalarPropertyMapping>)associationSetMapping.TargetEndMapping.PropertyMappings.ToList <ScalarPropertyMapping>());
            foreach (KeyValuePair <string, object> annotation in (IEnumerable <KeyValuePair <string, object> >) this._annotations)
            {
                table.AddAnnotation("http://schemas.microsoft.com/ado/2013/11/edm/customannotation:" + annotation.Key, annotation.Value);
            }
        }
Example #15
0
        public bool Equals(ManyToManyAssociationMappingConfiguration other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (!Equals(other._tableName, _tableName))
            {
                return false;
            }

            return Equals(other._tableName, _tableName)
                   && ((_leftKeyColumnNames.SequenceEqual(other._leftKeyColumnNames)
                        && _rightKeyColumnNames.SequenceEqual(other._rightKeyColumnNames))
                       || (_leftKeyColumnNames.SequenceEqual(other._rightKeyColumnNames)
                           && _rightKeyColumnNames.SequenceEqual(other._leftKeyColumnNames)))
                   && _annotations.OrderBy(a => a.Key).SequenceEqual(other._annotations.OrderBy(a => a.Key));
        }
 public Ef431ManyToManyAssociationMappingConfigurationAdapter(ManyToManyAssociationMappingConfiguration configuration)
 {
     _Configuration = configuration;
 }
        public bool Equals(ManyToManyAssociationMappingConfiguration other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (!Equals(other._tableName, _tableName))
            {
                return false;
            }

            return Equals(other._tableName, _tableName)
                   && ((_leftKeyColumnNames.SequenceEqual(other._leftKeyColumnNames)
                        && _rightKeyColumnNames.SequenceEqual(other._rightKeyColumnNames))
                       || (_leftKeyColumnNames.SequenceEqual(other._rightKeyColumnNames)
                           && _rightKeyColumnNames.SequenceEqual(other._leftKeyColumnNames)))
                   && _annotations.OrderBy(a => a.Key).SequenceEqual(other._annotations.OrderBy(a => a.Key));
        }
        public bool Equals(ManyToManyAssociationMappingConfiguration other)
        {
            if (ReferenceEquals(null, other))
            {
                return false;
            }

            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if (!Equals(other._tableName, _tableName))
            {
                return false;
            }

            if (_leftKeyColumnNames.SequenceEqual(other._leftKeyColumnNames)
                && _rightKeyColumnNames.SequenceEqual(other._rightKeyColumnNames))
            {
                return true;
            }

            if (_leftKeyColumnNames.SequenceEqual(other._rightKeyColumnNames)
                && _rightKeyColumnNames.SequenceEqual(other._leftKeyColumnNames))
            {
                return true;
            }

            return false;
        }