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

            if (id != tUserProcedureDeviceCode.ID)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GettUserProcedureDeviceCode(int id)
        {
            tUserProcedureDeviceCode tUserProcedureDeviceCode = await db.tUserProcedureDeviceCodes.FindAsync(id);

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

            return(Ok(tUserProcedureDeviceCode));
        }
        public async Task <IHttpActionResult> PosttUserProcedureDeviceCode(tUserProcedureDeviceCode tUserProcedureDeviceCode)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tUserProcedureDeviceCodes.Add(tUserProcedureDeviceCode);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = tUserProcedureDeviceCode.ID }, tUserProcedureDeviceCode));
        }
        public async Task <IHttpActionResult> DeletetUserProcedureDeviceCode(int id)
        {
            tUserProcedureDeviceCode tUserProcedureDeviceCode = await db.tUserProcedureDeviceCodes.FindAsync(id);

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

            db.tUserProcedureDeviceCodes.Remove(tUserProcedureDeviceCode);
            await db.SaveChangesAsync();

            return(Ok(tUserProcedureDeviceCode));
        }