Example #1
0
        public static Place FindPlaceBySegment(CopacesCcDbContext context, Segment segment)
        {
            var road = FindRoadBySegment(context, segment);
            if (road == null)
                return null;

            return FindPlaceByRoad(road);
        }
Example #2
0
        public static Road FindRoadBySegment(CopacesCcDbContext context, Segment segment)
        {
            var roadId = segment.RoadId;
            var matchRoad = context.Roads.Where(r => r.Id == roadId).ToList();
            if (!matchRoad.Any())
                return null;

            return matchRoad.First();
        }
Example #3
0
        public static void ProcessNewSegment(Segment segment)
        {
            //var road = FindRoadBySegment(new CopacesCcDbContext(), segment);
            //if (road != null)
            //    road.Segments.Add(segment);

            //var place = FindPlaceByRoad(road);
            //if (place != null)
            //    place.Segments.Add(segment);
        }