本文整理汇总了C#中IPropertyMap.GetAllColumnMaps方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyMap.GetAllColumnMaps方法的具体用法?C# IPropertyMap.GetAllColumnMaps怎么用?C# IPropertyMap.GetAllColumnMaps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyMap
的用法示例。
在下文中一共展示了IPropertyMap.GetAllColumnMaps方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateDLinqOneToManyFields
/*
private System.Nullable<int> _ReportsTo;
private EntityRef<Employee> _ReportsToEmployee;
* */
public static void GenerateDLinqOneToManyFields(IClassMap classMap, IPropertyMap propertyMap, CodeTypeDeclaration classDecl)
{
foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
{
string fieldName = propertyMap.GenerateMemberName(columnMap.Name);
CodeMemberField fieldMember = new CodeMemberField() ;
fieldMember.Name = fieldName;
//Add code for adding Nullable generics when OM is ported to .NET 2.0
CodeTypeReference typeReference = new CodeTypeReference(columnMap.GetSystemType());
fieldMember.Type = typeReference;
classDecl.Members.Add(fieldMember);
}
}
示例2: GetPropertyColumnNamesAndAliases
public virtual void GetPropertyColumnNamesAndAliases(IPropertyMap propertyMap, object hash, Hashtable columns, ArrayList order, string path, string propPath, string suggestion)
{
if (hash == null) { hash = propertyMap; }
SqlTableAlias tbl = sqlEmitter.GetTableAlias(propertyMap.MustGetTableMap(), hash) ;
IList columnAliases = new ArrayList();
if (propertyMap.IsIdentity)
{
IClassMap classMap = propertyMap.ClassMap;
IColumnMap typeColumnMap = classMap.GetTypeColumnMap();
if (typeColumnMap != null)
{
string pathParent = GetPathParent(path);
string suggestedPath = pathParent.Length == 0 ? "NPersistTypeColumn" : pathParent + ".NPersistTypeColumn";
SqlColumnAlias column = GetPropertyColumnAlias(tbl, suggestedPath , typeColumnMap, suggestedPath);
columnAliases.Add(column);
}
}
if (suggestion == "")
suggestion = propPath;
// bool hasTypeColumn = false;
IPropertyMap inverse = propertyMap.GetInversePropertyMap();
//Type column first
if (inverse != null)
{
IColumnMap inverseTypeColumnMap = inverse.ClassMap.GetTypeColumnMap();
foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
{
if (inverseTypeColumnMap != null && inverseTypeColumnMap == columnMap.GetPrimaryKeyColumnMap())
{
string suggestionString;
suggestionString = propPath.Length == 0 ? "NPersistTypeColum" : propPath + ".NPersistTypeColumn";
SqlColumnAlias column = GetPropertyColumnAlias(tbl, path, columnMap, suggestionString);
columnAliases.Add(column);
}
}
}
foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
{
if (inverse != null)
{
IColumnMap inverseTypeColumnMap = inverse.ClassMap.GetTypeColumnMap();
if ( inverseTypeColumnMap != null && inverseTypeColumnMap == columnMap.GetPrimaryKeyColumnMap())
{
continue;
}
}
string suggestionString;
suggestionString = suggestion;
SqlColumnAlias column = GetPropertyColumnAlias(tbl, path, columnMap, suggestionString);
columnAliases.Add(column);
}
foreach (SqlColumnAlias column in columnAliases)
{
if (!(columns.ContainsKey(column)))
{
columns[column] = column;
order.Add(column);
//Note: Important stuff, right here in nowhere-ville!!
if (this.sqlEmitter.PropertyColumnMap.ContainsKey(propPath))
{
ArrayList arrAliases;
if (this.sqlEmitter.PropertyColumnMap[propPath] is string)
{
arrAliases = new ArrayList() ;
arrAliases.Add(this.sqlEmitter.PropertyColumnMap[propPath]);
this.sqlEmitter.PropertyColumnMap[propPath] = arrAliases;
}
else
{
arrAliases = (ArrayList) this.sqlEmitter.PropertyColumnMap[propPath];
}
arrAliases.Add(column.Alias);
}
else
{
this.sqlEmitter.PropertyColumnMap[propPath] = column.Alias;
}
}
}
}
示例3: GenerateDLinqOneToManyProperties
public static void GenerateDLinqOneToManyProperties(IClassMap classMap, IPropertyMap propertyMap, CodeTypeDeclaration classDecl)
{
foreach (IColumnMap columnMap in propertyMap.GetAllColumnMaps())
{
string fieldName = propertyMap.GenerateMemberName(columnMap.Name);
string typeName = columnMap.GetSystemType().ToString();
CodeMemberProperty propertyMember = GenerateDLinqPrimitiveProperty(propertyMap, columnMap.Name, fieldName, typeName);
classDecl.Members.Add(propertyMember);
}
}