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

            db.mdPanelFunctions.Add(mdPanelFunction);
            await db.SaveChangesAsync();

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

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

            db.mdPanelFunctions.Remove(mdPanelFunction);
            await db.SaveChangesAsync();

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

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

            mdPanelFunction mdPanelFunction = await db.mdPanelFunctions.FindAsync(key);

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

            patch.Put(mdPanelFunction);

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

            return(Updated(mdPanelFunction));
        }