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

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GettVisitType(int id)
        {
            tVisitType tVisitType = await db.tVisitTypes.FindAsync(id);

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

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

            db.tVisitTypes.Add(tVisitType);
            await db.SaveChangesAsync();

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

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

            db.tVisitTypes.Remove(tVisitType);
            await db.SaveChangesAsync();

            return(Ok(tVisitType));
        }