// DELETE: odata/msCommunicationTypes(5)
        public async Task <IHttpActionResult> Delete([FromODataUri] int key)
        {
            msCommunicationType msCommunicationType = await db.msCommunicationTypes.FindAsync(key);

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

            db.msCommunicationTypes.Remove(msCommunicationType);
            await db.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }
        // PUT: odata/msCommunicationTypes(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <msCommunicationType> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            msCommunicationType msCommunicationType = await db.msCommunicationTypes.FindAsync(key);

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

            patch.Put(msCommunicationType);

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

            return(Updated(msCommunicationType));
        }