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

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public async Task <IHttpActionResult> GetNeedProject(int id)
        {
            NeedProject needProject = await db.NeedProjects.FindAsync(id);

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

            return(Ok(needProject));
        }
        public async Task <IHttpActionResult> PostNeedProject(NeedProject needProject)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.NeedProjects.Add(needProject);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = needProject.ID }, needProject));
        }
        public async Task <IHttpActionResult> DeleteNeedProject(int id)
        {
            NeedProject needProject = await db.NeedProjects.FindAsync(id);

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

            db.NeedProjects.Remove(needProject);
            await db.SaveChangesAsync();

            return(Ok(needProject));
        }