public async Task <IHttpActionResult> PutMachine_comment(int id, Machine_comment machine_comment)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != machine_comment.Com_id)
            {
                return(BadRequest());
            }

            db.Entry(machine_comment).State = EntityState.Modified;

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetMachine_comment(int id)
        {
            Machine_comment machine_comment = await db.Machine_Comments.FindAsync(id);

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

            return(Ok(machine_comment));
        }
        public async Task <IHttpActionResult> PostMachine_comment(Machine_comment machine_comment)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Machine_Comments.Add(machine_comment);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = machine_comment.Com_id }, machine_comment));
        }
        public async Task <IHttpActionResult> DeleteMachine_comment(int id)
        {
            Machine_comment machine_comment = await db.Machine_Comments.FindAsync(id);

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

            db.Machine_Comments.Remove(machine_comment);
            await db.SaveChangesAsync();

            return(Ok(machine_comment));
        }