static void Main(string[] args) { Ninject.IKernel kernal = new StandardKernel(); kernal.Load(Assembly.GetExecutingAssembly()); IRouteApplicationService _IRouteApplicationService = kernal.Get <IRouteApplicationService>(); string from = string.Empty; string to = string.Empty; do { var validationFrom = GetFrom(ref from); var validationTo = GetTo(ref to); if (validationFrom && validationTo) { var resultado = _IRouteApplicationService.BuildRoutes(from, to); System.Console.WriteLine(resultado); } }while (true); System.Console.ReadKey(); }
public IHttpActionResult Get(string from, string to) { try { var result = appService.BuildRoutes(from, to); if (result != null) { return(Ok(result)); } else { return(Ok("Não foi encontrado nenhum resultado")); } } catch (Exception ex) { return(BadRequest(ex.Message)); } }