src/Inflatable/QueryProvider/Providers/SQLServer/QueryGenerators/SavePropertiesQuery.cs
/// <summary>
/// Generates the join save query single.
/// </summary>
/// <param name="foreignIDProperties">The foreign identifier properties.</param>
/// <param name="manyToOne">The many to one.</param>
/// <param name="parentMapping">The parent 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 single.
Generates the join save query single .
private void GenerateJoinSaveQuerySingle(IEnumerable<IIDProperty> foreignIDProperties,
                    IManyToOneProperty manyToOne,
                    IMapping parentMapping,
                    StringBuilder whereList,
                    StringBuilder parametersList,
                    StringBuilder fromList)
        {
            var Splitter = string.Empty;
            foreach (var ForeignID in foreignIDProperties.Distinct())
            {
                parametersList.Append(Splitter).Append(GetTableName(parentMapping)
).Append(".["
).Append(manyToOne.ColumnName
).Append(ForeignID.ParentMapping.TableName
).Append(ForeignID.ColumnName
).Append("] = @"
).Append(manyToOne.ColumnName
).Append(ForeignID.ParentMapping.TableName
).Append(ForeignID.ColumnName);
                Splitter = ", ";
            }
            Splitter = string.Empty;
            foreach (var IDProperty in IDProperties)
            {
                whereList.Append(Splitter).Append(GetColumnName(IDProperty)).Append(" = ").Append(GetParameterName(IDProperty));
                Splitter = " AND ";
            }
            fromList.Append(GetTableName(parentMapping))
                .Append(GenerateFromClause(MappingInformation.TypeGraphs[parentMapping.ObjectType]?.Root));
        }
private void GenerateJoinSaveQuerySingle ( IEnumerable < IIDProperty > foreignIDProperties , IManyToOneProperty manyToOne , IMapping parentMapping , StringBuilder whereList , StringBuilder parametersList , StringBuilder fromList ) { var Splitter = string . Empty ; foreach ( var ForeignID in foreignIDProperties . Distinct ( ) ) { parametersList . Append ( Splitter ) . Append ( GetTableName ( parentMapping ) ) . Append ( " " ) . Append ( manyToOne . ColumnName ) . Append ( ForeignID . ParentMapping . TableName ) . Append ( ForeignID . ColumnName ) . Append ( " " ) . Append ( manyToOne . ColumnName ) . Append ( ForeignID . ParentMapping . TableName ) . Append ( ForeignID . ColumnName ) ; Splitter = " " ; } Splitter = string . Empty ; foreach ( var IDProperty in IDProperties ) { whereList . Append ( Splitter ) . Append ( GetColumnName ( IDProperty ) ) . Append ( " " ) . Append ( GetParameterName ( IDProperty ) ) ; Splitter = " " ; } fromList . Append ( GetTableName ( parentMapping ) ) . Append ( GenerateFromClause ( MappingInformation . TypeGraphs [ parentMapping . ObjectType ] ? . Root ) ) ; }
Generates the join save query single.
Generates the join save query single .
foreignIDProperties
IEnumerable<IIDProperty>
The foreign identifier properties.
The foreign identifier properties .
manyToOne
IManyToOneProperty
The many to one.
The many to one .
parentMapping
IMapping
The parent mapping.
The parent mapping .
whereList
StringBuilder
The where list.
The where list .
parametersList
StringBuilder
The parameters list.
The parameters list .
fromList
StringBuilder
None