Example #1
0
        public HttpResponseMessage Put(int Id, EventsUpdateRequest model)
        {
            if (model == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Request payload was null"));
            }
            if (!ModelState.IsValid)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
            model.UserId = UserService.GetCurrentUserId();

            EventsService.Put(Id, model);

            LocationServices _locationServices = new LocationServices();

            _locationServices.Put(model.Location.Id, model.Location);

            return(Request.CreateResponse(HttpStatusCode.OK, model));
        }