Пример #1
0
        public IHttpActionResult GetWorkout(int id)
        {
            Workout workout = db.Workouts.Include(w=> w.Movimientos)
                                         .Where(x=> x.Id == id).AsNoTracking()
                                         .FirstOrDefault();
            if (workout == null)
            {
                return NotFound();
            }

            WorkoutDTO dto = new WorkoutDTO(workout);
            return Ok(dto);
        }
Пример #2
0
        public IHttpActionResult GetWorkout(int id)
        {
            Workout workout = db.Workouts.Include(w => w.Movimientos)
                              .Where(x => x.Id == id).AsNoTracking()
                              .FirstOrDefault();

            if (workout == null)
            {
                return(NotFound());
            }

            WorkoutDTO dto = new WorkoutDTO(workout);

            return(Ok(dto));
        }