public IHttpActionResult PuttblPortfolioDetail(int id, tblPortfolioDetail tblPortfolioDetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tblPortfolioDetail.PortfolioID)
            {
                return(BadRequest());
            }

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

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!tblPortfolioDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PosttblPortfolioDetail(tblPortfolioDetail tblPortfolioDetail1)
        {
            db.tblPortfolioDetails.Add(tblPortfolioDetail1);
            db.SaveChanges();


            return(CreatedAtRoute("DefaultApi", new { id = tblPortfolioDetail1.CompanyID }, tblPortfolioDetail1));
        }
        public IHttpActionResult GettblPortfolioDetail(int id)
        {
            tblPortfolioDetail tblPortfolioDetail = db.tblPortfolioDetails.Find(id);

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

            return(Ok(tblPortfolioDetail));
        }
        public IHttpActionResult DeletetblPortfolioDetail(int id)
        {
            tblPortfolioDetail tblPortfolioDetail = db.tblPortfolioDetails.Find(id);

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

            db.tblPortfolioDetails.Remove(tblPortfolioDetail);
            db.SaveChanges();

            return(Ok(tblPortfolioDetail));
        }