// POST: odata/mdRemoteEndDetails
        public async Task <IHttpActionResult> Post(mdRemoteEndDetail mdRemoteEndDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.mdRemoteEndDetails.Add(mdRemoteEndDetail);
            await db.SaveChangesAsync();

            return(Created(mdRemoteEndDetail));
        }
        // DELETE: odata/mdRemoteEndDetails(5)
        public async Task <IHttpActionResult> Delete([FromODataUri] int key)
        {
            mdRemoteEndDetail mdRemoteEndDetail = await db.mdRemoteEndDetails.FindAsync(key);

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

            db.mdRemoteEndDetails.Remove(mdRemoteEndDetail);
            await db.SaveChangesAsync();

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

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

            mdRemoteEndDetail mdRemoteEndDetail = await db.mdRemoteEndDetails.FindAsync(key);

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

            patch.Put(mdRemoteEndDetail);

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

            return(Updated(mdRemoteEndDetail));
        }