コード例 #1
0
        public IHttpActionResult GetIntroduce(int id)
        {
            IntroducesDTO intro = IntroducesDAO.Instance.GetIntroducts(id);

            if (intro == null)
            {
                return(NotFound());
            }
            return(Ok(intro));
        }
コード例 #2
0
 public IHttpActionResult PostIntroduce(IntroducesDTO introduce)
 {
     if (InsertIntroduce(introduce.Name, introduce.Img, introduce.Data, introduce.Describe, introduce.Color))
     {
         return(CreatedAtRoute("DefaultApi", new { id = introduce.Id }, introduce));
     }
     else
     {
         return(BadRequest());
     }
 }
コード例 #3
0
 public IHttpActionResult PutIntroduce(int id, IntroducesDTO introduce)
 {
     if (EditIntroduce(id, introduce.Name, introduce.Img, introduce.Data, introduce.Describe, introduce.Color))
     {
         return(StatusCode(HttpStatusCode.NoContent));
     }
     else
     {
         return(BadRequest());
     }
 }