本文整理汇总了C#中IClassMap.DOLGetFindByGroups方法的典型用法代码示例。如果您正苦于以下问题:C# IClassMap.DOLGetFindByGroups方法的具体用法?C# IClassMap.DOLGetFindByGroups怎么用?C# IClassMap.DOLGetFindByGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClassMap
的用法示例。
在下文中一共展示了IClassMap.DOLGetFindByGroups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateFindByMethods
/// <summary>
/// Generates all the 'find by' methods of this interface.
/// </summary>
/// <param name="classMap">The class map.</param>
/// <param name="file">The file.</param>
private static void GenerateFindByMethods(IClassMap classMap, StreamWriter file)
{
foreach (KeyValuePair<int, IList<IPropertyMap>> pair in classMap.DOLGetFindByGroups())
{
IList<IPropertyMap> paramProps = pair.Value;
string findBy = StringUtility.CombineObjects(paramProps, MapToStringConverters.PropertyAnd)
.ToString();
// method name
file.Write(" IList<" + EntityGenerator.GetTypeName(classMap) + "> FindBy" + findBy);
// method's params
file.Write("(");
bool first = true;
foreach (IPropertyMap propertyMap in paramProps)
{
if (!first)
{
file.Write(", ");
}
// param type and name
string paramName = ClassUtility.GetParamName(propertyMap);
string paramType = ClassUtility.ConvertColumnTypeToCsType(propertyMap.GetColumnMap().DataType);
file.Write(paramType + " " + paramName);
first = false;
}
file.Write(");");
file.WriteLine();
}
}
示例2: GenerateAllCountBy
/// <summary>
/// Generates all the 'count by' methods.
/// </summary>
/// <param name="file">The file.</param>
/// <param name="classMap">The class map.</param>
private void GenerateAllCountBy(StreamWriter file, IClassMap classMap)
{
// get all 'count by' groups
foreach (KeyValuePair<int, IList<IPropertyMap>> pair in classMap.DOLGetFindByGroups())
{
IList<IPropertyMap> paramProps = pair.Value;
string findBy = StringUtility.CombineObjects(paramProps, MapToStringConverters.PropertyAnd)
.ToString();
// method name
file.Write(" public virtual long CountBy" + findBy);
// method's params
file.Write("(");
bool first = true;
foreach (IPropertyMap propertyMap in paramProps)
{
if (!first)
{
file.Write(", ");
}
// param type and name
string paramName = ClassUtility.GetParamName(propertyMap);
string paramType = ClassUtility.ConvertColumnTypeToCsType(propertyMap.GetColumnMap().DataType);
file.Write(paramType + " " + paramName);
first = false;
}
file.Write(")");
file.WriteLine();
file.WriteLine(" {");
GenerateCountBy(file, paramProps, classMap);
file.WriteLine(" }");
file.WriteLine();
}
}