Ejemplo n.º 1
0
        public async Task <IHttpActionResult> PutExercise_history(int id, Exercise_history exercise_history)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != exercise_history.Exeh_id)
            {
                return(BadRequest());
            }

            db.Entry(exercise_history).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Exercise_historyExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> GetExercise_history(int id)
        {
            Exercise_history exercise_history = await db.Exercise_historyes.FindAsync(id);

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

            return(Ok(exercise_history));
        }
Ejemplo n.º 3
0
        public async Task <IHttpActionResult> PostExercise_history(Exercise_history exercise_history)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Exercise_historyes.Add(exercise_history);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = exercise_history.Exeh_id }, exercise_history));
        }
Ejemplo n.º 4
0
        public async Task <IHttpActionResult> DeleteExercise_history(int id)
        {
            Exercise_history exercise_history = await db.Exercise_historyes.FindAsync(id);

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

            db.Exercise_historyes.Remove(exercise_history);
            await db.SaveChangesAsync();

            return(Ok(exercise_history));
        }