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

            if (id != eventoOrcamento.IdEventoOrcamento)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetEventoOrcamento(int id)
        {
            EventoOrcamento eventoOrcamento = await db.EventoOrcamentoes.FindAsync(id);

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

            return(Ok(eventoOrcamento));
        }
        public async Task <IHttpActionResult> PostEventoOrcamento(EventoOrcamento eventoOrcamento)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.EventoOrcamentoes.Add(eventoOrcamento);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = eventoOrcamento.IdEventoOrcamento }, eventoOrcamento));
        }
        public async Task <IHttpActionResult> DeleteEventoOrcamento(int id)
        {
            EventoOrcamento eventoOrcamento = await db.EventoOrcamentoes.FindAsync(id);

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

            db.EventoOrcamentoes.Remove(eventoOrcamento);
            await db.SaveChangesAsync();

            return(Ok(eventoOrcamento));
        }