Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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));
            }
        }