本文整理汇总了C#中IMethod.Any方法的典型用法代码示例。如果您正苦于以下问题:C# IMethod.Any方法的具体用法?C# IMethod.Any怎么用?C# IMethod.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethod
的用法示例。
在下文中一共展示了IMethod.Any方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseMethod
/// <summary>
/// Fetches the method from the type of query
/// </summary>
/// <param name="method"></param>
protected virtual List<string> ParseMethod(IMethod method) {
List<string> parsed = new List<string>();
if (method is Find) {
parsed.Add("SELECT");
}
else if (method is Save) {
parsed.Add("INSERT");
}
else if (method is Merge) {
parsed.Add("REPLACE");
}
else if (method is Create) {
if (method.Any(statement => statement is Builders.Database) == true || method.Any(statement => statement is Collection) == true) {
parsed.Add("CREATE");
}
else if (method.Any(statement => statement is Field) == true) {
parsed.Add("ADD");
}
}
else if (method is Modify) {
parsed.Add("UPDATE");
}
else if (method is Remove) {
parsed.Add("DELETE");
}
else if (method is Drop) {
parsed.Add("DROP");
}
else if (method is Index) {
parsed.Add("CREATE");
}
else if (method is Alter) {
parsed.Add("ALTER");
}
return parsed;
}
示例2: ParseMethod
protected virtual List<String> ParseMethod(IMethod method) {
List<String> parsed = new List<string>();
if (method.Any(item => item is Distinct) == true) {
parsed.Add("distinct");
}
else if (method is Create) {
parsed.Add("create");
}
else if (method is Find) {
parsed.Add("find");
}
else if (method is Remove) {
parsed.Add("remove");
}
else if (method is Modify) {
parsed.Add("update");
}
else if (method is Save) {
parsed.Add("save");
}
else if (method is Drop) {
parsed.Add("drop");
}
else if (method is Merge) {
parsed.Add("findAndModify");
}
return parsed;
}