本文整理汇总了C#中IAdapter.GetSimple方法的典型用法代码示例。如果您正苦于以下问题:C# IAdapter.GetSimple方法的具体用法?C# IAdapter.GetSimple怎么用?C# IAdapter.GetSimple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAdapter
的用法示例。
在下文中一共展示了IAdapter.GetSimple方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestGetSimple
private void TestGetSimple(IAdapter adapter, int count)
{
adapter.Prepare();
Stopwatch stp = new Stopwatch();
stp.Start();
for (int i = 0; i < count; i++)
{
ShipMethodDto dto5 = adapter.GetSimple(5);
ShipMethodDto dto3 = adapter.GetSimple(3);
ShipMethodDto dto1 = adapter.GetSimple(1);
ShipMethodDto dto2 = adapter.GetSimple(2);
ShipMethodDto dto4 = adapter.GetSimple(4);
}
stp.Stop();
Console.WriteLine("{0,-30} - {1,6} ms {2,6} us",
adapter.Name,
stp.ElapsedMilliseconds,
Math.Round(1000.0 * stp.Elapsed.TotalMilliseconds / (5 * count), 4));
adapter.Relase();
}
示例2: TestCombined
private void TestCombined(IAdapter adapter, int count)
{
int[] productIds = new int[]
{
752, 928, 756, 858, 711, 788, 743, 990, 948, 769, 979, 906, 833,
741, 790, 776, 919, 822, 819, 976, 718, 913, 887, 751, 911, 739,
765, 836, 873, 967,
};
adapter.Prepare();
Stopwatch stp = new Stopwatch();
stp.Start();
for (int i = 0; i < count; i++)
{
adapter.GetPagedPersons(i * 25 + 3, 25);
adapter.GetSimple(2);
adapter.GetSimple(3);
adapter.GetProduct(productIds[i % productIds.Length]);
adapter.GetProduct2(productIds[i % productIds.Length]);
adapter.GetSimple(3);
adapter.GetPagedPersons(i * 25 + 3, 25);
adapter.GetProduct(productIds[i % productIds.Length]);
adapter.GetProduct2(productIds[i % productIds.Length]);
adapter.GetProduct(productIds[i % productIds.Length]);
adapter.GetSimple(3);
adapter.GetSimple(3);
adapter.GetProduct(productIds[i % productIds.Length]);
}
stp.Stop();
Console.WriteLine("{0,-30} - {1,6} ms {2,6} us",
adapter.Name,
stp.ElapsedMilliseconds,
Math.Round(1000.0 * stp.Elapsed.TotalMilliseconds / count, 4));
adapter.Relase();
}