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


C# Query.GetRecordCount方法代码示例

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


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

示例1: DataProvider_GetRecordCount

 public void DataProvider_GetRecordCount()
 {
     Query q = new Query(Product.Schema)
         .WHERE(Product.Columns.ProductID, 1)
         .WHERE(Product.Columns.ProductName, "Chai");
     int count = q.GetRecordCount();
     Assert.IsTrue(count == 1, "Count is " + count);
 }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:8,代码来源:DataServiceTest.cs

示例2: CheckUserAlreadyVoted

 public static bool CheckUserAlreadyVoted(Guid pollId, Guid userId)
 {
     Query qry = new Query(ACSGhana.Web.Framework.Data.Tables.PollVotes);
     qry.AddWhere(PollVotes.Columns.PollId, pollId);
     qry.AddWhere(PollVotes.Columns.UserId, userId);
     if (qry.GetRecordCount() > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:14,代码来源:Poll.cs

示例3: CountTotalVotes

 public static int CountTotalVotes(Guid pollId)
 {
     Query qry = new Query(ACSGhana.Web.Framework.Data.Tables.PollVotes);
     qry.AddWhere(PollVotes.Columns.PollId, pollId);
     return qry.GetRecordCount();
 }
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:6,代码来源:Poll.cs

示例4: NumberOfVotesByAnswer

 public static int NumberOfVotesByAnswer(System.Guid answerid)
 {
     Query qry = new Query(ACSGhana.Web.Framework.Data.Tables.PollVotes);
     qry.AddWhere(PollVotes.Columns.PollAnswerId, answerid);
     return qry.GetRecordCount();
 }
开发者ID:okyereadugyamfi,项目名称:softlogik,代码行数:6,代码来源:Poll.cs

示例5: GetNumberOfUserRegistrations

        /// <summary>
        /// Gets the number of user registrations.
        /// </summary>
        /// <param name="hostID">The host ID.</param>
        /// <param name="year">The year.</param>
        /// <param name="month">The month.</param>
        /// <param name="day">The day.</param>
        /// <returns></returns>
        public static int GetNumberOfUserRegistrations(int hostID, int year, int? month, int? day)
        {
            string cacheKey = String.Format("Zeitgeist_UserRegistrationCount_{0}_{1}_{2}_{3}", hostID, year, month, day);
            CacheManager<string, int?> countCache = GetUserRegistrationCountCache();
            int? count = countCache[cacheKey];

            if (count == null)
            {
                Query qry = new Query(User.Schema);
                qry.AddWhere(User.Columns.IsBanned, false);
                qry.AddWhere(User.Columns.IsValidated, true);
                qry.AddWhere(User.Columns.HostID, hostID);
                qry.AddWhere(User.Columns.CreatedOn, Comparison.GreaterOrEquals, StartingDate(year, month, day));
                qry.AddWhere(User.Columns.CreatedOn, Comparison.LessOrEquals, EndingDate(year, month, day));
                count = qry.GetRecordCount();
                countCache.Insert(cacheKey, count.Value, CacheHelper.CACHE_DURATION_IN_SECONDS);
            }

            return count.Value;
        }
开发者ID:Letractively,项目名称:dotnetkicks,代码行数:28,代码来源:ZeitgeistCache.cs

示例6: GetNumberOfStoriesSubmitted

        /// <summary>
        /// Gets the number of stories submitted.
        /// </summary>
        /// <param name="hostID">The host id.</param>
        /// <returns></returns>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <param name="day"></param>
        public static int GetNumberOfStoriesSubmitted(int hostID, int year, int? month, int? day)
        {
            string cacheKey = String.Format("Zeitgeist_SubmittedCount_{0}_{1}_{2}_{3}", hostID, year, month, day);
            CacheManager<string, int?> countCache = GetStoryCountCache();
            int? count = countCache[cacheKey];

            if (count == null)
            {
                Query qry = new Query(Story.Schema);
                qry.AddWhere(Story.Columns.IsSpam, false);
                qry.AddWhere(Story.Columns.HostID, hostID);
                qry.AddWhere(Story.Columns.CreatedOn, Comparison.GreaterOrEquals, StartingDate(year, month, day));
                qry.AddWhere(Story.Columns.CreatedOn, Comparison.LessOrEquals, EndingDate(year, month, day));
                count = qry.GetRecordCount();// GetCount(Story.Columns.StoryID);
                countCache.Insert(cacheKey, count.Value, CacheHelper.CACHE_DURATION_IN_SECONDS);
            }

            return count.Value;
        }
开发者ID:Letractively,项目名称:dotnetkicks,代码行数:27,代码来源:ZeitgeistCache.cs


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