本文整理汇总了C#中ColumnCollection.Where方法的典型用法代码示例。如果您正苦于以下问题:C# ColumnCollection.Where方法的具体用法?C# ColumnCollection.Where怎么用?C# ColumnCollection.Where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColumnCollection
的用法示例。
在下文中一共展示了ColumnCollection.Where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrimaryKeys
internal PrimaryKeys(ColumnCollection columns)
{
var pk = columns.Where(column => (column as ColumnSchema).PkContraintName != null);
this.keys = pk.Select(column => column.ColumnName).ToArray();
if (this.keys.Length != 0)
this.constraintName = pk.Select(column => (column as ColumnSchema).PkContraintName).First();
}
示例2: ComputedColumns
internal ComputedColumns(ColumnCollection columns)
{
this.columnNames = columns.Where(column => column.IsComputed).Select(column => column.ColumnName).ToArray();
}
示例3: ForeignKeys
public ForeignKeys(TableName tableName, ColumnCollection columns)
{
var fkeys = columns.Where(column => (column as ColumnSchema).FkContraintName != null).ToArray();
this.keys = new ForeignKey[fkeys.Length];
int i = 0;
foreach (var fk in fkeys)
this.keys[i++] = new ForeignKey(tableName, fk);
}
示例4: IdentityKeys
internal IdentityKeys(ColumnCollection columns)
{
this.columnNames = columns.Where(column => column.IsIdentity).Select(column => column.ColumnName).ToArray();
}
示例5: AggregatesToString
/// <summary>
/// Aggregateses to string.
/// </summary>
/// <param name="columns">The columns.</param>
/// <returns>System.String.</returns>
private string AggregatesToString(ColumnCollection columns)
{
var srcTree = new XDocument(new XElement("Root"));
var root = srcTree.Element("Root");
foreach (var column in columns.Where(c => c.GroupLevel == null))
{
if (column.AggregateCriteriaList != null && column.AggregateCriteriaList.Count > 0)
{
var aggregate = new XElement("Aggregate");
root.Add(aggregate);
aggregate.Add(
new XElement(
"ColumnName",
string.Format(
CultureInfo.InvariantCulture,
"{0}",
string.Format(
CultureInfo.InvariantCulture, "{0}{1}", string.IsNullOrEmpty(column.Prefix) ? string.Empty : column.Prefix + ".", column.ColumnName.Replace(" ", string.Empty)))));
var funcs = new XElement("AggregateFunctions");
aggregate.Add(funcs);
foreach (var func in column.AggregateCriteriaList)
{
var data = new XElement("Function");
funcs.Add(data);
data.Add(new XElement("ProcessName", ProcessSystemName ?? string.Empty));
data.Add(new XElement("SelectedColumn", func.ColumnName ?? string.Empty));
data.Add(new XElement("SummaryType", func.SummaryType.ToString() ?? string.Empty));
data.Add(new XElement("FilterId", FilterId.ToString(CultureInfo.InvariantCulture) ?? string.Empty));
data.Add(new XElement("CustomConverter", func.CustomConverter ?? string.Empty));
data.Add(new XElement("TargetType", func.TargetType ?? string.Empty));
data.Add(new XElement("TypeName", func.TypeName ?? string.Empty));
data.Add(new XElement("ConverterParameter", func.ConverterParameter ?? string.Empty));
}
}
}
return srcTree.ToString();
}