public async Task <IHttpActionResult> PutEmplWithPosition(int id, EmplWithPosition emplWithPosition)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != emplWithPosition.EmployeeID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> PostEmplWithPosition(EmplWithPosition emplWithPosition)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.EmplWithPositions.Add(emplWithPosition);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (EmplWithPositionExists(emplWithPosition.EmployeeID))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = emplWithPosition.EmployeeID }, emplWithPosition));
        }
        public async Task <IHttpActionResult> DeleteEmplWithPosition(int id)
        {
            EmplWithPosition emplWithPosition = await db.EmplWithPositions.FindAsync(id);

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

            db.EmplWithPositions.Remove(emplWithPosition);
            await db.SaveChangesAsync();

            return(Ok(emplWithPosition));
        }