src/Inflatable/QueryProvider/Providers/SQLServer/QueryGenerators/SavePropertiesQuery.cs
/// <summary>
/// Generates the join save query multiple.
/// </summary>
/// <param name="manyToOne">The many to one.</param>
/// <param name="foreignMapping">The temporary mapping.</param>
/// <param name="whereList">The where list.</param>
/// <param name="parametersList">The parameters list.</param>
/// <param name="fromList">From list.</param>
Generates the join save query multiple.
Generates the join save query multiple .
private void GenerateJoinSaveQueryMultiple(IManyToOneProperty manyToOne,
                    IMapping foreignMapping,
                    StringBuilder whereList,
                    StringBuilder parametersList,
                    StringBuilder fromList)
        {
            var Splitter = string.Empty;
            foreach (var ForeignIDs in manyToOne.GetColumnInfo().Where(x => x.IsForeign).Distinct())
            {
                parametersList.Append(Splitter).Append("[").Append(ForeignIDs.SchemaName).Append("].[").Append(ForeignIDs.TableName).Append("].[").Append(ForeignIDs.ColumnName).Append("] = @").Append(ForeignIDs.ColumnName);
                Splitter = ", ";
            }
            Splitter = string.Empty;
            foreach (var ForeignIDs in manyToOne.GetColumnInfo().Where(x => !x.IsForeign))
            {
                whereList.Append(Splitter).Append("[").Append(ForeignIDs.SchemaName).Append("].[").Append(ForeignIDs.TableName).Append("].[").Append(ForeignIDs.ColumnName).Append("] = @").Append(ForeignIDs.ColumnName);
                Splitter = " AND ";
            }
            fromList.Append(GetTableName(foreignMapping));
            if (manyToOne.ForeignMapping != null)
                fromList.Append(GenerateFromClause(MappingInformation.TypeGraphs[foreignMapping.ObjectType]?.Root));
        }
private void GenerateJoinSaveQueryMultiple ( IManyToOneProperty manyToOne , IMapping foreignMapping , StringBuilder whereList , StringBuilder parametersList , StringBuilder fromList ) { var Splitter = string . Empty ; foreach ( var ForeignIDs in manyToOne . GetColumnInfo ( ) . Where ( x => x . IsForeign ) . Distinct ( ) ) { parametersList . Append ( Splitter ) . Append ( " " ) . Append ( ForeignIDs . SchemaName ) . Append ( " " ) . Append ( ForeignIDs . TableName ) . Append ( " " ) . Append ( ForeignIDs . ColumnName ) . Append ( " " ) . Append ( ForeignIDs . ColumnName ) ; Splitter = " " ; } Splitter = string . Empty ; foreach ( var ForeignIDs in manyToOne . GetColumnInfo ( ) . Where ( x => ! x . IsForeign ) ) { whereList . Append ( Splitter ) . Append ( " " ) . Append ( ForeignIDs . SchemaName ) . Append ( " " ) . Append ( ForeignIDs . TableName ) . Append ( " " ) . Append ( ForeignIDs . ColumnName ) . Append ( " " ) . Append ( ForeignIDs . ColumnName ) ; Splitter = " " ; } fromList . Append ( GetTableName ( foreignMapping ) ) ; if ( manyToOne . ForeignMapping != null ) fromList . Append ( GenerateFromClause ( MappingInformation . TypeGraphs [ foreignMapping . ObjectType ] ? . Root ) ) ; }
Generates the join save query multiple.
Generates the join save query multiple .
manyToOne
IManyToOneProperty
The many to one.
The many to one .
foreignMapping
IMapping
The temporary mapping.
The temporary mapping .
whereList
StringBuilder
The where list.
The where list .
parametersList
StringBuilder
The parameters list.
The parameters list .
fromList
StringBuilder
None