当前位置: 首页>>代码示例>>C#>>正文


C# IQueryable.ToString方法代码示例

本文整理汇总了C#中IQueryable.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IQueryable.ToString方法的具体用法?C# IQueryable.ToString怎么用?C# IQueryable.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IQueryable的用法示例。


在下文中一共展示了IQueryable.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DebugWriteQuery

        public static void DebugWriteQuery(IQueryable query)
        {
#if DEBUG
            // プロトタイプではデバッガに出力
            var oQuery = query as ObjectQuery;
            if (oQuery != null)
            {
                System.Diagnostics.Trace.WriteLine(oQuery.ToTraceString());
            }
            else
            {
                System.Diagnostics.Trace.WriteLine(query.ToString());
            }
#endif
        }
开发者ID:matarillo,项目名称:Oryzae,代码行数:15,代码来源:LogUtility.cs

示例2: ExecuteQuery

        public static List<Package> ExecuteQuery(IQueryable<Package> query, TextWriter log, bool verbose)
        {
            if (verbose)
            {
                log.WriteLine(query.ToString());
            }

            DateTime before = DateTime.Now;

            List<Package> list = query.ToList();

            DateTime after = DateTime.Now;

            log.WriteLine("Packages: {0} rows returned, duration {1} seconds", list.Count, (after - before).TotalSeconds);

            return list;
        }
开发者ID:jinujoseph,项目名称:NuGet.Services.Metadata,代码行数:17,代码来源:GalleryExport.cs

示例3: QueryTest

 private static void QueryTest(IQueryable<Question> query, IEnumerable<string> expected, string assertMessage)
 {
     var actual = query.ToString();
     Assert.IsTrue(expected.Contains(actual, StringComparer.InvariantCultureIgnoreCase), assertMessage);
 }
开发者ID:efrGas,项目名称:net-training-master-36e6aeeb22ad48924667c891c0a7152db767bcaf,代码行数:5,代码来源:QueryableTests.cs

示例4: TrimQueryText

 private static string TrimQueryText(IQueryable<WorkItem> actual)
 {
     string actualWiql = string.Join(" ", actual.ToString().Split(new string[] { Environment.NewLine, " " }, StringSplitOptions.RemoveEmptyEntries).ToArray());
     return actualWiql;
 }
开发者ID:richarddavis42,项目名称:mirror,代码行数:5,代码来源:WiqlPartsTest.cs

示例5: GetResource

		public object GetResource(IQueryable query, string fullTypeName)
		{
			object obj;
			TraceHelper.Current.MethodCall2("DataServiceUpdateProvider", "GetResource", query.ToString(), fullTypeName);
			try
			{
				DSLinqQueryProvider provider = query.Provider as DSLinqQueryProvider;
				ExceptionHelpers.ThrowArgumentExceptionIf("query", provider == null, Resources.QueryDoesNotIncludePswsProvider, new object[0]);
				if (!provider.IsFilterOverResourceRoot(query.Expression))
				{
					ReferredResourceExtractor referredResourceExtractor = new ReferredResourceExtractor();
					DSResource current = null;
					if (!referredResourceExtractor.Extract(query.Expression, provider.GetInitialQueryable(), provider.GetInitialResourceType(), provider.GetEntityMetadata(provider.GetInitialResourceType())))
					{
						IEnumerator<DSResource> enumerator = (query.GetEnumerator() as IEnumerable<DSResource>).GetEnumerator();
						if (enumerator.MoveNext())
						{
							current = enumerator.Current;
							if (enumerator.MoveNext())
							{
								throw new ArgumentException("multiple instances");
							}
						}
						else
						{
							throw new ArgumentException("no instances");
						}
					}
					else
					{
						current = referredResourceExtractor.ReferredResource;
					}
					ResourceType resourceType = current.ResourceType;
					EntityMetadata entityMetadata = provider.GetEntityMetadata(resourceType);
					IUpdateInstance referredEntityInstance = new ReferredEntityInstance(current, this.dataContext.UserContext, resourceType, entityMetadata, this.dataContext.MembershipId);
					this.instances.Add(referredEntityInstance);
					obj = referredEntityInstance;
				}
				else
				{
					ResourceType initialResourceType = provider.GetInitialResourceType();
					EntityMetadata entityMetadatum = provider.GetEntityMetadata(initialResourceType);
					this.entityInstance = new EntityUpdate(CommandType.Update, this.dataContext.UserContext, initialResourceType, entityMetadatum, query, this.dataContext.MembershipId);
					this.instances.Add(this.entityInstance);
					obj = this.entityInstance;
				}
			}
			catch (ArgumentException argumentException1)
			{
				ArgumentException argumentException = argumentException1;
				TraceHelper.Current.InvalidUpdateQuery(fullTypeName, query.ToString(), argumentException.GetType().ToString(), argumentException.Message);
				obj = null;
			}
			return obj;
		}
开发者ID:nickchal,项目名称:pash,代码行数:55,代码来源:DataServiceUpdateProvider.cs


注:本文中的IQueryable.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。