private GetBasePKColumn ( |
||
column | ||
리턴 |
private void AppendInsertMapScalar(Table currentTable) { try { //Get all columns for all inheritance foreach (var currentColumn in _fullHierarchyColumnCache[currentTable]) { if (currentColumn.RelationshipRef == null && !currentColumn.ComputedColumn && !currentColumn.IsReadOnly && (!currentColumn.PrimaryKey || currentTable.GetBasePKColumn(currentColumn).Identity != IdentityTypeConstants.Database)) { //var typeTable = _relatedTypeTableCache[currentColumn]; //if (typeTable != null) //{ // sb.AppendLine(" <ComplexProperty Name=\"" + typeTable.PascalName + "\" TypeName=\"" + this.GetLocalNamespace() + ".Entity." + typeTable.PascalName + "Wrapper\">"); // sb.AppendLine(" <ScalarProperty Name=\"Value\" ParameterName=\"" + currentColumn.DatabaseName + "\" />"); // sb.AppendLine(" </ComplexProperty>"); //} //else { sb.AppendFormat(" <ScalarProperty Name=\"{0}\" ParameterName=\"{1}\" />", currentColumn.PascalName, currentColumn.DatabaseName).AppendLine(); } } } if (currentTable.AllowCreateAudit) { sb.AppendFormat(" <ScalarProperty Name=\"{0}\" ParameterName=\"{1}\" />", _model.Database.CreatedByPascalName, _model.Database.CreatedByDatabaseName).AppendLine(); sb.AppendFormat(" <ScalarProperty Name=\"{0}\" ParameterName=\"{1}\" />", _model.Database.CreatedDatePascalName, _model.Database.CreatedDateDatabaseName).AppendLine(); } if (currentTable.AllowModifiedAudit) { sb.AppendFormat(" <ScalarProperty Name=\"{0}\" ParameterName=\"{1}\" />", _model.Database.ModifiedByPascalName, _model.Database.ModifiedByDatabaseName).AppendLine(); } } catch (Exception ex) { throw; } }
private void AppendInsertReturnProperties(Table currentTable) { foreach (var currentColumn in _fullHierarchyColumnCache[currentTable]) { if (currentColumn.PrimaryKey && currentTable.GetBasePKColumn(currentColumn).Identity != IdentityTypeConstants.Database) { //Do Nothing } else if (!currentColumn.IsForeignKeyIgnoreInheritance()) { sb.AppendFormat(" <ResultBinding Name=\"{0}\" ColumnName=\"{1}\" />", currentColumn.PascalName, currentColumn.DatabaseName).AppendLine(); } } if (currentTable.AllowCreateAudit) { sb.AppendFormat(" <ResultBinding Name=\"{0}\" ColumnName=\"{1}\" />", _model.Database.CreatedByPascalName, _model.Database.CreatedByDatabaseName).AppendLine(); sb.AppendFormat(" <ResultBinding Name=\"{0}\" ColumnName=\"{1}\" />", _model.Database.CreatedDatePascalName, _model.Database.CreatedDateDatabaseName).AppendLine(); } if (currentTable.AllowModifiedAudit) { sb.AppendFormat(" <ResultBinding Name=\"{0}\" ColumnName=\"{1}\" />", _model.Database.ModifiedByPascalName, _model.Database.ModifiedByDatabaseName).AppendLine(); sb.AppendFormat(" <ResultBinding Name=\"{0}\" ColumnName=\"{1}\" />", _model.Database.ModifiedDatePascalName, _model.Database.ModifiedDateDatabaseName).AppendLine(); } if (currentTable.AllowTimestamp) { sb.AppendFormat(" <ResultBinding Name=\"{0}\" ColumnName=\"{1}\" />", _model.Database.TimestampPascalName, _model.Database.TimestampDatabaseName).AppendLine(); } }