本文整理汇总了C#中Fields.Any方法的典型用法代码示例。如果您正苦于以下问题:C# Fields.Any方法的具体用法?C# Fields.Any怎么用?C# Fields.Any使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareIo
private List<NamedConnection> PrepareIo(IEnumerable<TflIo> collection, Fields fields) {
var namedConnections = new List<NamedConnection>();
var entity = fields.Any() ? fields[0].Entity : "None";
foreach (var io in collection) {
Func<Row, bool> shouldRun = row => true;
if (!io.RunField.Equals(string.Empty)) {
var f = io.RunField;
var match = fields.Find(f).ToArray();
if (match.Length > 0) {
var field = match[0];
if (io.RunType.Equals(DEFAULT)) {
io.RunType = field.SimpleType;
}
var op = (ComparisonOperator)Enum.Parse(typeof(ComparisonOperator), io.RunOperator, true);
var simpleType = Common.ToSimpleType(io.RunType);
var value = Common.ConversionMap[simpleType](io.RunValue);
shouldRun = row => Common.CompareMap[op](row[field.Alias], value);
} else {
_process.Logger.EntityWarn(entity, "Field {0} specified in {1} output doesn't exist. It will not affect the output.", io.RunField, io.Name);
}
}
namedConnections.Add(new NamedConnection {
Name = io.Name,
Connection = _process.Connections.GetConnectionByName(io.Connection).Connection,
ShouldRun = shouldRun
});
}
return namedConnections;
}