Beispiel #1
0
        public ActionResult Create(RouteVM routeVM)
        {
            _routeApplicationService.Add(routeVM);
            var routesVMs = _routeApplicationService.GetAll();

            return(View("Index", routesVMs));
        }
        public IActionResult Post(RouteVM RouteVM)
        {
            //if (ModelState.IsValid)
            if (true)
            {
                try
                {
                    var newClient = _routeApplicationService.Add(RouteVM);

                    if (string.IsNullOrEmpty(newClient.DT_RowId))
                    {
                        return(Ok(newClient));
                    }
                    else
                    {
                        return(NotFound());
                    }
                }
                catch (Exception ex)
                {
                    return(BadRequest(ex.Message));
                }
            }
        }