コード例 #1
0
        public void Test_GetNearestNamedRoad()
        {
            var result = testCandidate.GetNearestNamedRoad(dbGeometry, "abc");

            Assert.IsNotNull(result);
            Assert.AreEqual(result.Item1.LinkGeometry, lineGeometry);
            Assert.That(result.Item1.Id, Is.AssignableFrom(typeof(Guid)));
        }
コード例 #2
0
        public IActionResult GetNearestNamedRoad([FromBody] string operationalObjectPointJson, string streetName)
        {
            using (loggingHelper.RMTraceManager.StartTrace("Controller.GetNearestNamedRoad"))
            {
                string methodName = typeof(NetworkManagerController) + "." + nameof(GetNearestNamedRoad);
                loggingHelper.LogMethodEntry(methodName, priority, entryEventId);

                Tuple <NetworkLinkDTO, SqlGeometry> result;

                result = networkManagerBusinessService.GetNearestNamedRoad(JsonConvert.DeserializeObject <DbGeometry>(operationalObjectPointJson, new DbGeometryConverter()), streetName);

                var convertedResult = new Tuple <NetworkLinkDTO, DBGeometryDTO>(result.Item1, new DBGeometryDTO {
                    Geometry = result.Item2.IsNull ? null : result.Item2.ToDbGeometry()
                });

                loggingHelper.LogMethodExit(methodName, priority, exitEventId);
                return(Ok(convertedResult));
            }
        }