예제 #1
0
        public IHttpActionResult Post([FromBody] EventModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var userId  = User.Identity.GetUserId <int>();
            var succes  = ServiceResponce.FromSuccess().Result("Concert save complete");
            var error   = ServiceResponce.FromFailed().Result($"Error save concert");
            var concert = _concertService.SaveConcert(model, userId);

            if (concert == null)
            {
                return(Ok(error.Response()));
            }
            succes.Add("concertId", concert.Id);
            return(Ok(succes.Response()));
        }