public async Task <IHttpActionResult> PutPositionRequest(PositionRequest entity)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _dbContext.ApplyChanges(entity);

            try
            {
                await _dbContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!_dbContext.PositionRequests.Any(e => e.RequestId == entity.RequestId))
                {
                    return(Conflict());
                }
                throw;
            }

            await _dbContext.LoadRelatedEntitiesAsync(entity);

            entity.AcceptChanges();
            return(Ok(entity));
        }
        public async Task <IHttpActionResult> PostPositionRequest(PositionRequest entity)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            entity.TrackingState = TrackingState.Added;
            _dbContext.ApplyChanges(entity);


            try
            {
                await _dbContext.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (_dbContext.PositionRequests.Any(e => e.RequestId == entity.RequestId))
                {
                    return(Conflict());
                }
                throw;
            }

            await _dbContext.LoadRelatedEntitiesAsync(entity);

            entity.AcceptChanges();
            return(CreatedAtRoute("DefaultApi", new { id = entity.RequestId }, entity));
        }