예제 #1
0
        public HttpResponseMessage Post(WebContactUs contactUs)
        {
            if (!ModelState.IsValid || contactUs == null)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ModelState));
            }

            try
            {
                repo.sendContactUs(this.currentUserId, GetIPAddress.Get(this.Request), contactUs);
                return(Request.CreateResponse(HttpStatusCode.Created));
            }
            catch (Exception e)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, e));
            }
        }