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


C# IQueryBuilder类代码示例

本文整理汇总了C#中IQueryBuilder的典型用法代码示例。如果您正苦于以下问题:C# IQueryBuilder类的具体用法?C# IQueryBuilder怎么用?C# IQueryBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GenericQueryPart

		/// <summary>
		///     Creates a generic query part that can be used for any query
		/// </summary>
		/// <param name="prefix"></param>
		/// <param name="parameters"></param>
		/// <param name="builder">The type of building object</param>
		public GenericQueryPart(string prefix, IEnumerable<IQueryParameter> parameters, IQueryBuilder builder)
		{
			_builder = builder;
			Debug.Assert(prefix != null, "prefix != null");
			Prefix = prefix;
			QueryParameters = parameters;
		}
开发者ID:JPVenson,项目名称:DataAccess,代码行数:13,代码来源:GenericQueryPart.cs

示例2: GetStationCollectionAsync

        public static void GetStationCollectionAsync(IQueryBuilder url, RealTimeDataDelegate callback)
        {
            try
            {
                if (url == null) throw new Exception("Cannot work with null-objects");
                if (String.IsNullOrEmpty(url.Url)) throw new Exception("Url cannot be empty");

                var client = new WebClient();

                client.DownloadStringCompleted += (s, e) =>
                {
                    if (e.Error != null) throw e.Error;
                    if (e.Result == null) return;

                    var collection = JsonHelper.Deserialize<
                        IList<Station>>(e.Result);

                    callback(new ObservableCollection<Station>(collection));
                };

                client.DownloadStringAsync(new Uri(url.Url));
            }
            catch (Exception)
            {
                throw;
            }
        }
开发者ID:henningms,项目名称:trafikantendotnet,代码行数:27,代码来源:Realtime.cs

示例3: FurnitureCreator

 public FurnitureCreator(
     IRoomReader roomReader,
     IQueryBuilder queryBuilder)
 {
     this.roomReader = roomReader;
     this.queryBuilder = queryBuilder;
 }
开发者ID:sunloving,项目名称:rooms-and-furniture,代码行数:7,代码来源:FurnitureCreator.cs

示例4: ExecuteReaderAndRead

 public static void ExecuteReaderAndRead( this IDbTransaction dbTransaction, IQueryBuilder query, Action<IDataReader> action )
 {
     ExecuteReader( dbTransaction,
                    query.GetSql(),
                    query.GetParameters(),
                    dataReader => dataReader.Read( action ) );
 }
开发者ID:StarTrekRedneck,项目名称:IDbEz,代码行数:7,代码来源:DbTransactionExtensions.cs

示例5: CreateQuery

        /// <summary>
        /// Creates the query for this class.
        /// </summary>
        /// <param name="qb">The <see cref="IQueryBuilder"/> instance.</param>
        /// <returns>The query for this class.</returns>
        static string CreateQuery(IQueryBuilder qb)
        {
            // SELECT * FROM `{0}`

            var q = qb.Select(GuildTable.TableName).AllColumns();
            return q.ToString();
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:12,代码来源:SelectGuildsQuery.cs

示例6: Load

        private static IList<Status> Load(IQueryBuilder queryBuilder, ulong maxId, int count = 2000)
        {
            var statuses = new List<Status>();
            //todo limit exception System.AggregateException, message: Rate limit exceeded - Please visit the LINQ to Twitter FAQ (at the HelpLink) for help on resolving this error.
            var tweetQuery = queryBuilder.BuildTaskByMinId(maxId + 1).ToList();

            statuses.AddRange(tweetQuery);

            if (statuses.Count < 150)
            {
                return statuses;
            }

            while (statuses.Count < count)
            {
                tweetQuery = queryBuilder.BuildTaskByMinIdAndMaxId(maxId + 1, statuses[statuses.Count - 1].StatusID - 1).ToList();

                statuses.AddRange(tweetQuery);
                if (tweetQuery.Count < 150)
                {
                    break;
                }
            }
            return statuses;
        }
开发者ID:Stelmashenko-A,项目名称:CourseWork,代码行数:25,代码来源:UpDater.cs

示例7: CreateQuery

        /// <summary>
        /// Creates the query for this class.
        /// </summary>
        /// <param name="qb">The <see cref="IQueryBuilder"/> instance.</param>
        /// <returns>The query for this class.</returns>
        static string CreateQuery(IQueryBuilder qb)
        {
            // SELECT `id` FROM `{0}`

            var q = qb.Select(QuestTable.TableName).Add("id");
            return q.ToString();
        }
开发者ID:wtfcolt,项目名称:game,代码行数:12,代码来源:SelectQuestIDsQuery.cs

示例8: BuildQual

        public virtual string BuildQual(IQueryBuilder builder)
        {
            if (!builder.StatusClauseAdded)
            {
                // builder
            }

            var set = builder.StoredClauses;

            var clauses = this.ExecuteStoredClauses(set).Distinct(new ClauseComparer()).ToList();

            var qual = new StringBuilder();
            foreach (var clause in clauses)
            {
                if (string.IsNullOrEmpty(qual.ToString()))
                {
                    qual.Append(clause.Value ?? string.Empty);
                }
                else
                {
                    qual.Append(string.Format("{0} {1} ", clause.Operator == ClauseOperator.AND ? " AND" : " OR", clause.Value ?? string.Empty));
                }
            }

            return qual.ToString();
        }
开发者ID:jeremyshantz,项目名称:bmc-remedy-search,代码行数:26,代码来源:ReadAbleProvider.cs

示例9: CreateQuery

        /// <summary>
        /// Creates the query for this class.
        /// </summary>
        /// <param name="qb">The <see cref="IQueryBuilder"/> instance.</param>
        /// <returns>The query for this class.</returns>
        static string CreateQuery(IQueryBuilder qb)
        {
            // CALL find_foreign_keys(@schema,@table,@column)

            var q = qb.CallProcedure("find_foreign_keys").AddParam(SchemaParameterName, TableParameterName, ColumnParameterName);
            return q.ToString();
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:12,代码来源:MySqlFindForeignKeysQuery.cs

示例10: MusicModule

        public MusicModule(IQueryBuilder queryBuilder, ICommandBuilder commandBuilder)
            : base("/music")
        {
            _queryBuilder = queryBuilder;
            _commandBuilder = commandBuilder;

            Get["/"] = _ =>
            {
                this.RequiresAuthentication();
                this.RequiresReadClaim("music");

                var paging = this.BindAndValidate<Paging>();
                var result = _queryBuilder.For<IPagedEnumerable<TrackDto>>().With(paging);

                return Response.AsAccepted(result, new[] { "json", "m3u" }, model => Response.AsJson(model));
            };

            Post["/"] = _ =>
            {
                this.RequiresAuthentication();
                this.RequiresWriteClaim("music");

                var model = this.BindAndValidate<AddTrack>();
                _commandBuilder.Execute(model);

                return new Response
                {
                    StatusCode = HttpStatusCode.Created
                };
            };

            Post["/tagged"] = _ =>
            {
                this.RequiresAuthentication();
                this.RequiresWriteClaim("music");

                var model = this.BindAndValidate<MarkTrackWithTags>();
                _commandBuilder.Execute(model);

                return new Response
                {
                    StatusCode = HttpStatusCode.OK
                };
            };

            Delete["/tagged"] = _ =>
            {
                this.RequiresAuthentication();
                this.RequiresWriteClaim("music");

                var model = this.BindAndValidate<RemoreTagsFromTrack>();
                _commandBuilder.Execute(model);

                return new Response
                {
                    StatusCode = HttpStatusCode.OK
                };
            };
        }
开发者ID:andrewyakonyuk,项目名称:Vault,代码行数:59,代码来源:MusicModule.cs

示例11: RootExecuteReader

 private static void RootExecuteReader( this IDbConnection dbConnection, IQueryBuilder queryBuilder, Action<IDataReader> action )
 {
     using ( IDbCommand dbCommand = dbConnection.CreateCommand( queryBuilder ) )
     using ( IDataReader dataReader = dbCommand.ExecuteReader() )
     {
         action( dataReader );
     }
 }
开发者ID:StarTrekRedneck,项目名称:IDbEz,代码行数:8,代码来源:DbConnectionExtensions.cs

示例12: SelectRequest

 public SelectRequest(SolrUriBuilder builder, IQueryBuilder queryBuilder)
     : base(builder)
 {
     UrlBuilder.Handler = "select";
     if (queryBuilder == null)
         throw new ArgumentNullException("queryBuilder");
     UrlBuilder.SetQuery(queryBuilder);
 }
开发者ID:hiiru,项目名称:Mizore,代码行数:8,代码来源:SelectRequest.cs

示例13: CreateQuery

        /// <summary>
        /// Creates the query for this class.
        /// </summary>
        /// <param name="qb">The <see cref="IQueryBuilder"/> instance.</param>
        /// <returns>The query for this class.</returns>
        static string CreateQuery(IQueryBuilder qb)
        {
            // UPDATE `{0}` SET `server_time`=NOW()

            var f = qb.Functions;
            var q = qb.Update(ServerTimeTable.TableName).Add("server_time", f.Now());
            return q.ToString();
        }
开发者ID:mateuscezar,项目名称:netgore,代码行数:13,代码来源:UpdateServerTimeQuery.cs

示例14: CalcService

 public CalcService()
 {
     InitializeComponent();
     IoC.Init();
     _query = IoC.Resolve<IQueryBuilder>();
     _periodsRepository = IoC.Resolve<IRepository<Period>>();
     _statisticDataRepository = IoC.Resolve<IRepository<StatisticalData>>();
     _dynamicDataRepository = IoC.Resolve<IRepository<DynamicData>>();
     _unitOfWorkFactory = IoC.Resolve<IUnitOfWorkFactory>();
 }
开发者ID:Eskat0n,项目名称:Wotstat,代码行数:10,代码来源:CalcService.cs

示例15: CreateQuery

        /// <summary>
        /// Creates the query for this class.
        /// </summary>
        /// <param name="qb">The <see cref="IQueryBuilder"/> instance.</param>
        /// <returns>The query for this class.</returns>
        static string CreateQuery(IQueryBuilder qb)
        {
            // SELECT `id` FROM `{0}` WHERE `repeatable` = 1

            var f = qb.Functions;
            var s = qb.Settings;
            var q = qb.Select(QuestTable.TableName).Add("id")
                .Where(f.Equals(s.EscapeColumn("repeatable"), "1"));
            return q.ToString();
        }
开发者ID:Furt,项目名称:netgore,代码行数:15,代码来源:SelectRepeatableQuestsQuery.cs


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