Exemple #1
0
        public HttpResponseMessage Create(OrganizerCreateModel model)
        {
            if (model == null)
            {
                ModelState.AddModelError("", "You did not send any data!");
            }
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(
                           HttpStatusCode.BadRequest,
                           ModelState
                           ));
            }
            IOrganizerService organizerService = new OrganizerService();
            int id = organizerService.Create(model);

            return(Request.CreateResponse(HttpStatusCode.Created, id));
        }