Пример #1
0
 public long Split(long StructureA, LocationLink locLink)
 {
     return 0;
 }
Пример #2
0
        public LocationLink[] LocationLinksForSection(long section, long ModifiedAfterThisUtcTime, out long QueryExecutedTime, out LocationLink[] DeletedLinks)
        {
            //TODO: This needs a real assignment, but I haven't created the table yet
            DeletedLinks = new LocationLink[0];
            DateTime start = DateTime.Now;
            DateTime? ModifiedAfter;
            if (ModifiedAfterThisUtcTime == 0)
            {
                ModifiedAfter = new DateTime?();
            }
            else
            {
                ModifiedAfter = new DateTime?(new DateTime(ModifiedAfterThisUtcTime, DateTimeKind.Unspecified));
            }
            QueryExecutedTime = DateTime.Now.ToUniversalTime().Ticks;
            try
            {
                //IQueryable<DBLocation> queryResults = from l in db.DBLocations where ((double)section) == l.Z select l;
                List<DBLocationLink> locationLinks;
                locationLinks = db.SelectSectionLocationLinks(new double?(section), ModifiedAfter).ToList<DBLocationLink>();

                Debug.WriteLine(section.ToString() + ": Query: " + new TimeSpan(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds);

                LocationLink[] retList = new LocationLink[locationLinks.Count];

                Debug.WriteLine(section.ToString() + ": To list: " + new TimeSpan(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds);
                for (int i = 0; i < locationLinks.Count; i++)
                {
                    retList[i] = new LocationLink(locationLinks[i]);
                }

                Debug.WriteLine(section.ToString() + ": Loop: " + new TimeSpan(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds);

                return retList;
            }
            catch (System.ArgumentNullException)
            {
                //This means there was no row with that ID;
                Debug.WriteLine("Could not find locatioWat>cns for section: " + section.ToString());
            }
            catch (System.InvalidOperationException e)
            {
                //This means there was no row with that ID;
                Debug.WriteLine("Could not find locations for section: " + section.ToString());
            }

            return new LocationLink[0];
        }