本文整理汇总了C#中Microsoft.OData.Edm.Library.EdmModel.ResolveOperations方法的典型用法代码示例。如果您正苦于以下问题:C# EdmModel.ResolveOperations方法的具体用法?C# EdmModel.ResolveOperations怎么用?C# EdmModel.ResolveOperations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Edm.Library.EdmModel
的用法示例。
在下文中一共展示了EdmModel.ResolveOperations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EdmModel
public void ResolveOperationsWithFullyQualifiedOperationNameAndParametersWithoutParameterNamesShouldReturnCorrectOperations()
{
var model = new EdmModel();
var function = new EdmFunction("ds", "function1", EdmCoreModel.Instance.GetSingle(false), true /*isBound*/, null /*entitysetpath*/, false /*isComposable*/);
function.AddParameter("bindingParameter", this.productTypeReference);
function.AddParameter("param1", EdmCoreModel.Instance.GetSingle(true));
var functionOverload1 = new EdmFunction("ds", "function1", EdmCoreModel.Instance.GetSingle(false), true /*isBound*/, null /*entitysetpath*/, false /*isComposable*/);
functionOverload1.AddParameter("bindingParameter", this.productTypeReference);
functionOverload1.AddParameter("param1", EdmCoreModel.Instance.GetSingle(true));
functionOverload1.AddParameter("param2", EdmCoreModel.Instance.GetSingle(true));
model.AddElement(function);
model.AddElement(functionOverload1);
var returnedOperations = model.ResolveOperations("ds.function1(param1)", true /*allowParameterTypeNames*/).ToList();
returnedOperations.Count.Should().Be(1);
returnedOperations[0].Should().BeSameAs(function);
}
示例2: ResolveOperationsWithOperationNameWithoutParameterNamesShouldReturnCorrectOperations
public void ResolveOperationsWithOperationNameWithoutParameterNamesShouldReturnCorrectOperations()
{
var model = new EdmModel();
var function = new EdmFunction("ds", "function1", EdmCoreModel.Instance.GetSingle(false));
model.AddElement(function);
var returnedOperations = model.ResolveOperations("ds.function1", false /*allowParameterTypeNames*/).ToList();
returnedOperations.Count.Should().Be(1);
returnedOperations[0].Should().BeSameAs(function);
}