private UpdatePart GetInsertForPrimitiveListTable(PrimitiveListTable primitiveListTable, IEnumerable<PropertyMapping> propGroup) { var insertBuilder = new InsertSqlBuilder(primitiveListTable); var updatePart = new PrimitiveInsertListPart(); foreach (var prop in primitiveListTable.Columns) { var paramerter = new Parameter() { Name = insertBuilder.AddInsert(prop.ColumnName), Property = prop }; updatePart.Parameters.Add(paramerter); } updatePart.SqlString = insertBuilder.GetSql(); updatePart.PropertyName = propGroup.First(z => z.DeclaredType != null).Name; return updatePart; }
private static UpdatePart GetInsertForEntity(EntityTable mainTable, IEnumerable<PropertyMapping> propGroup) { var insertBuilder = new InsertSqlBuilder(mainTable); var updatePart = new UpdatePart(); if (mainTable.HasDiscriminator) { propGroup = Enumerable.Repeat(mainTable.DiscriminatorColumn, 1).Concat(propGroup); } foreach (var prop in propGroup) { var paramerter = new Parameter() { Name = insertBuilder.AddInsert(prop.ColumnName), Property = prop }; updatePart.Parameters.Add(paramerter); } updatePart.SqlString = insertBuilder.GetSql(); return updatePart; }