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;
}
}