本文整理汇总了C#中Promise.Continue方法的典型用法代码示例。如果您正苦于以下问题:C# Promise.Continue方法的具体用法?C# Promise.Continue怎么用?C# Promise.Continue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Promise
的用法示例。
在下文中一共展示了Promise.Continue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCompletions
//.........这里部分代码省略.........
case "version":
case "isCriteria":
case "related_expand":
case "serverEvents":
items = StringPromise("0", "1");
break;
case "queryType":
items = StringPromise("Effective", "Latest", "Released");
break;
case "orderBy":
if (!string.IsNullOrEmpty(path.Last().Type)
&& _itemTypes.TryGetValue(path.Last().Type, out itemType))
{
var lastComma = attrValue.LastIndexOf(",");
if (lastComma >= 0) attrValue = attrValue.Substring(lastComma + 1).Trim();
items = GetProperties(itemType)
.Convert(p => p.SelectMany(i => new string[] { i.Name, i.Name + " DESC" }));
}
multiValueAttribute = true;
break;
case "select":
if (!string.IsNullOrEmpty(path.Last().Type)
&& _itemTypes.TryGetValue(path.Last().Type, out itemType))
{
string partial;
var selectPath = SelectPath(attrValue, out partial);
attrValue = partial;
var itPromise = new Promise<ItemType>();
RecurseProperties(itemType, selectPath, it => itPromise.Resolve(it));
items = itPromise
.Continue(it => GetProperties(it))
.Convert(p => p.Select(i => i.Name));
}
multiValueAttribute = true;
break;
case "type":
if (path.Count > 2
&& path[path.Count - 3].LocalName == "Item"
&& path[path.Count - 2].LocalName == "Relationships")
{
if (!string.IsNullOrEmpty(path[path.Count - 3].Type)
&& _itemTypes.TryGetValue(path[path.Count - 3].Type, out itemType))
{
items = StringPromise(itemType.Relationships.Select(r => r.Name));
}
}
else
{
items = StringPromise(_itemTypes.Select(i => i.Value.Name));
}
break;
case "where":
if (!string.IsNullOrEmpty(path.Last().Type)
&& _itemTypes.TryGetValue(path.Last().Type, out itemType))
{
items = GetProperties(itemType)
.Convert(i => i.Select(p => "[" + itemType.Name + "].[" + p.Name + "]"));
}
multiValueAttribute = true;
break;
}
}
else