public async Task <IHttpActionResult> PutVocabulary(int id, Vocabulary item)
        {
            VocabularyBL vocabularyBL = new VocabularyBL(_context);

            if (!id.Equals(item.vocaID))
            {
                return(BadRequest());
            }

            else if (!vocabularyBL.VocabularyExists(id))
            {
                var ItemId = await vocabularyBL.CreateNewVocabulary(item);

                if (ItemId == null)
                {
                    return(InternalServerError());
                }

                return(Created(Request.RequestUri, item));
            }
            var isUpdated = await vocabularyBL.UpdateVocabulary(item);

            if (isUpdated == false)
            {
                return(InternalServerError());
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> DeleteVocabulary(int id)
        {
            VocabularyBL vocabularyBL = new VocabularyBL(_context);

            if (!vocabularyBL.VocabularyExists(id))
            {
                return(NotFound());
            }

            var result = await vocabularyBL.DeleteVocabularyItem(id);

            if (result == null)
            {
                return(InternalServerError());
            }

            return(Ok(result));
        }