예제 #1
0
        public IActionResult GetPaths()
        {
            try
            {
                List <Path> paths = _pathRepository.GetAll().ToList();

                paths.ForEach(path =>
                {
                    path.Origin  = _pointRepository.GetById(path.OriginId);
                    path.Destiny = _pointRepository.GetById(path.DestinyId);
                });

                return(Ok(paths));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
 public bool Exists(long id)
 {
     return(Repo.GetAll().Count(e => e.Id == id) > 0);
 }