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

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GettConsent(int id)
        {
            tConsent tConsent = await db.tConsents.FindAsync(id);

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

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

            db.tConsents.Add(tConsent);
            await db.SaveChangesAsync();

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

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

            db.tConsents.Remove(tConsent);
            await db.SaveChangesAsync();

            return(Ok(tConsent));
        }