コード例 #1
0
        private List <CafeDto> GetBaseCafesQuery()
        {
            //DataSet dataSet = new DataQuery("DancingGoatMvc.Cafe.GetAllCafe")
            //                     .Execute();
            //DataSet dataSet1 = ConnectionHelper.ExecuteQuery("Proc_Custom_GetAllUsers", null, QueryTypeEnum.StoredProcedure);

            return(CafeProvider.GetCafes()
                   .OrderBy("NodeOrder")
                   .AsEnumerable()
                   .Select(x =>
            {
                return new CafeDto()
                {
                    CafeID = x.CafeID,
                    CafeName = x.CafeName,
                    CafeIsCompanyCafe = x.CafeIsCompanyCafe,
                    CafeStreet = x.CafeStreet,
                    CafeCity = x.CafeCity,
                    CafeCountry = x.CafeCountry,
                    CafeZipCode = x.CafeZipCode,
                    CafePhone = x.CafePhone,
                    CafeAdditionalNotes = x.CafeAdditionalNotes
                };
            })
                   .ToList());
        }
コード例 #2
0
 /// <summary>
 /// Returns an enumerable collection of partner cafes ordered by a position in the content tree.
 /// </summary>
 /// <returns>An enumerable collection of partner cafes ordered by a position in the content tree.</returns>
 public IEnumerable <Cafe> GetPartnerCafes()
 {
     return(CafeProvider.GetCafes()
            .LatestVersion(mLatestVersionEnabled)
            .Published(!mLatestVersionEnabled)
            .OnSite(mSiteName)
            .Culture(mCultureName)
            .WhereFalse("CafeIsCompanyCafe")
            .OrderBy("NodeOrder"));
 }
コード例 #3
0
 /// <summary>
 /// Shared <see cref="DocumentQuery"/> for querying cafes.
 /// </summary>
 private DocumentQuery <Cafe> GetBaseCafesQuery()
 {
     return(CafeProvider.GetCafes()
            .LatestVersion(mLatestVersionEnabled)
            .Published(!mLatestVersionEnabled)
            .OnSite(SiteContext.CurrentSiteName)
            .Culture(mCultureName)
            .CombineWithDefaultCulture()
            .OrderBy("NodeOrder"));
 }
コード例 #4
0
 /// <summary>
 /// Returns an enumerable collection of company cafes ordered by a position in the content tree.
 /// </summary>
 /// <param name="count">The number of cafes to return.</param>
 /// <returns>An enumerable collection that contains the specified number of cafes ordered by a position in the content tree.</returns>
 public IEnumerable <Cafe> GetCompanyCafes(int count = 0)
 {
     return(CafeProvider.GetCafes()
            .LatestVersion(mLatestVersionEnabled)
            .Published(!mLatestVersionEnabled)
            .OnSite(mSiteName)
            .Culture(mCultureName)
            .WhereTrue("CafeIsCompanyCafe")
            .OrderBy("NodeOrder")
            .TopN(count));
 }
コード例 #5
0
 /// <summary>
 /// Returns an enumerable collection of partner cafes ordered by a position in the content tree.
 /// </summary>
 /// <returns>An enumerable collection of partner cafes ordered by a position in the content tree.</returns>
 public IEnumerable <Cafe> GetPartnerCafes()
 {
     return(CafeProvider.GetCafes()
            .LatestVersion(mLatestVersionEnabled)
            .Published(!mLatestVersionEnabled)
            .OnSite(SiteContext.CurrentSiteName)
            .Culture(mCultureName)
            .CombineWithDefaultCulture()
            .WhereFalse("CafeIsCompanyCafe")
            .OrderBy("NodeOrder")
            .ToList());
 }
コード例 #6
0
 private List <CafeModel> GetBaseCafesQuery()
 {
     return(CafeProvider.GetCafes()
            .OrderBy("NodeOrder")
            .AsEnumerable()
            .Select(x =>
     {
         return new CafeModel()
         {
             CafeID = x.CafeID,
             CafeName = x.CafeName,
             CafeIsCompanyCafe = x.CafeIsCompanyCafe,
             CafeStreet = x.CafeStreet,
             CafeCity = x.CafeCity,
             CafeCountry = x.CafeCountry,
             CafeZipCode = x.CafeZipCode,
             CafePhone = x.CafePhone,
             CafeAdditionalNotes = x.CafeAdditionalNotes
         };
     })
            .ToList());
 }