コード例 #1
0
ファイル: StoreManager.cs プロジェクト: Dung2781993/cmt
        /// <summary>
        ///     Load all stores from the database based on businessName.
        /// </summary>
        /// <param name="businessName"></param>
        /// <returns></returns>
        private StoreSet LoadStoreSetFromBusinessName(string businessName)
        {
            var storeSet        = new StoreSet();
            var metaData        = new LinqMetaData();
            var storeCollection = metaData.Store.Where(s => s.BusinessName == businessName);

            if (storeCollection.Any())
            {
                storeSet.AddRange(storeCollection.Select(entity => new Store(entity)));
            }
            return(storeSet);
        }
コード例 #2
0
ファイル: StoreManager.cs プロジェクト: Dung2781993/cmt
        /// <summary>
        ///     Load all stores from the database.
        /// </summary>
        /// <returns></returns>
        private StoreSet LoadStoreSet()
        {
            var storeSet = new StoreSet();
            // Get the collection from the ORM data layer
            var metaData = new LinqMetaData();

            IQueryable <StoreEntity> storeOptions = from s in metaData.Store select s;

            var storeCollection = ((ILLBLGenProQuery)storeOptions).Execute <StoreCollection>();

            // Fill the entity set from the data collection
            if (storeCollection.Count > 0)
            {
                storeSet.AddRange(storeCollection.Select(entity => new Store(entity)));
            }

            // Return the entity set
            return(storeSet);
        }