public async Task <IHttpActionResult> PutSubstitutionGoingOn(int id, SubstitutionGoingOn substitutionGoingOn)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != substitutionGoingOn.Id)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetSubstitutionGoingOn(int id)
        {
            SubstitutionGoingOn substitutionGoingOn = await db.SubstitutionGoingOns.FindAsync(id);

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

            return(Ok(substitutionGoingOn));
        }
        public async Task <IHttpActionResult> PostSubstitutionGoingOn(SubstitutionGoingOn substitutionGoingOn)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.SubstitutionGoingOns.Add(substitutionGoingOn);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = substitutionGoingOn.Id }, substitutionGoingOn));
        }
        public async Task <IHttpActionResult> DeleteSubstitutionGoingOn(int id)
        {
            SubstitutionGoingOn substitutionGoingOn = await db.SubstitutionGoingOns.FindAsync(id);

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

            db.SubstitutionGoingOns.Remove(substitutionGoingOn);
            await db.SaveChangesAsync();

            return(Ok(substitutionGoingOn));
        }