コード例 #1
0
        public IEnumerable <DONN.LS.Entities.TempLocations> GetItems(string uid, string type, int interval, DateTime sTime, DateTime eTime, int index, int count)
        {
            type  = type.ToLower();
            eTime = eTime.ToUniversalTime();
            sTime = sTime.ToUniversalTime();
            IQueryable <TempLocations> query;

            using (var instantlyContext = new LocationContext(locationOptionsBuilder.Options))
            {
                query = instantlyContext.TempLocations.AsNoTracking().Where(
                    t => t.UniqueId == uid && t.Type == type && t.SendTime <eTime &&
                                                                            t.SendTime> sTime);
                if (interval != 0)
                {
                    query = query.Where(t => t.CustomInterval > interval);
                }
                return(query.Skip((index - 1) * count).Take(count).ToList());
            }
        }
コード例 #2
0
 public Base(string connectionString)
 {
     InitDbContextOptionsBuilder(connectionString);
     LocationContext = new LocationContext(locationOptionsBuilder.Options);
 }