Exemple #1
0
        public ConferenceInfo Put(ConferenceInfo conference)
        {
            _tracer.Info(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, "ConferenceController: PUT");

            if (_user == null)
            {
                _tracer.Info(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, "User not found returning 404");
                this.NotFound();
            }

            if (conference.PublishNow)
            {
                try
                {
                    this.service.Publish(conference.Id);
                }
                catch (System.Exception exc)
                {
                    _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, exc);
                    throw;
                }
            }

            return(conference);
        }
Exemple #2
0
        public void Post([FromUri] string slug, [FromBody] SeatType seat)
        {
            _tracer.Info(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, "SeatController: POST");

            if (_user == null)
            {
                _tracer.Info(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, "User not found returning 404");
                this.NotFound();
            }

            var conference = this.service.FindConference(slug);

            try
            {
                seat.Id = GuidUtil.NewSequentialId();
                this.service.CreateSeat(conference.Id, seat);
            }
            catch (System.Exception exc)
            {
                _tracer.Error(Request, this.ControllerContext.ControllerDescriptor.ControllerType.FullName, exc);
                throw;
            }
        }
 public override void Log(ExceptionLoggerContext context)
 {
     TraceWriter.Error(context.Request, nameof(NLogExceptionLogger), context.Exception);
 }