Exemple #1
0
        public async Task <string[]> GetIdsAsync(ISearchCriteria criteria, long index1, long index2)
        {
            var filter = criteria.GetFilterString(this);

            using (var connection = await this.Database.ConnectAsync().ConfigureAwait(false))
            {
                return(await this.GetRegionIdsMainAsync(connection, criteria, index1, index2, filter)
                       .ConfigureAwait(false));
            }
        }
Exemple #2
0
 /// <summary>
 /// 指定検索条件下でのインデックスを調べる
 /// </summary>
 /// <param name="criteria"></param>
 /// <param name="target"></param>
 /// <returns></returns>
 public async Task <long> FindIndexAsync(ISearchCriteria criteria, Record target)
 {
     if (criteria == null)
     {
         return(0);
     }
     using (var connection = await this.Records.Parent.ConnectAsync().ConfigureAwait(false))
     {
         return(await this.FindIndexMainAsync
                    (connection, criteria, criteria.GetFilterString(this), target).ConfigureAwait(false));
     }
 }
Exemple #3
0
        /// <summary>
        /// 全てのIDを取得
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public async Task <string[]> GetAllIdsAsync(ISearchCriteria criteria)
        {
            var filter = criteria.GetFilterString(this);

            using (var connection = await this.Database.ConnectAsync().ConfigureAwait(false))
            {
                return(await this.Records
                       .AsQueryable(connection)
                       .Where(filter)
                       .Select <string>(nameof(Record.Id))
                       .ToArrayAsync()
                       .ConfigureAwait(false));
            }
        }
Exemple #4
0
        /// <summary>
        /// 二つのレコードの間にあるIDを取得(指定レコードの物を含まない)
        /// </summary>
        /// <param name="criteria"></param>
        /// <param name="record1"></param>
        /// <param name="record2"></param>
        /// <returns></returns>
        public async Task <string[]> GetRegionIdsAsync(ISearchCriteria criteria, Record record1, Record record2)
        {
            var filter = criteria.GetFilterString(this);

            using (var connection = await this.Database.ConnectAsync().ConfigureAwait(false))
            {
                var index1 = await this.FindIndexMainAsync(connection, criteria, filter, record1)
                             .ConfigureAwait(false);

                var index2 = await this.FindIndexMainAsync(connection, criteria, filter, record2)
                             .ConfigureAwait(false);

                return(await this.GetRegionIdsMainAsync(connection, criteria, index1, index2, filter)
                       .ConfigureAwait(false));
            }
        }