public List <ContactCategory> Get()
        {
            PBABusinessLayer bll = new PBABusinessLayer();
            var lstCat           = bll.GetAllcategoryNames();

            return(lstCat);
        }
        public HttpResponseMessage DeleteContact(int id)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "Record Deleted");

            try
            {
                PBABusinessLayer bll = new PBABusinessLayer();
                bll.DeleteContactById(id);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.NotFound, ex.Message);
            }
            return(errRes);
        }
        public HttpResponseMessage AddContact([FromBody] Contact contact)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "Record Inserted");

            try
            {
                PBABusinessLayer bll = new PBABusinessLayer();
                bll.AddContact(contact);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.NotFound, ex.Message);
            }
            return(errRes);
        }
        public HttpResponseMessage Put([FromBody] ContactCategory cat, int id)
        {
            HttpResponseMessage errRes = Request.CreateErrorResponse(HttpStatusCode.OK, "Record Updated");

            try
            {
                PBABusinessLayer bll = new PBABusinessLayer();
                bll.UpdateCategoryById(cat);
            }
            catch (Exception ex)
            {
                errRes = Request.CreateErrorResponse(HttpStatusCode.NotFound, ex.Message);
            }
            return(errRes);
        }
        public HttpResponseMessage Get(int id)
        {
            HttpResponseMessage res = Request.CreateErrorResponse(HttpStatusCode.OK, "Record Found");

            try
            {
                PBABusinessLayer bll = new PBABusinessLayer();
                var lstContacts      = bll.GetAllContactsById(id);
                return(res = Request.CreateResponse <List <Contact> >(lstContacts));
            }
            catch (Exception ex)
            {
                res = Request.CreateErrorResponse(HttpStatusCode.NotFound, ex.Message);
            }
            return(res);
        }