Пример #1
0
        public async Task <IActionResult> AddAttendee([FromBody] AttendeeDTO attendeeDTO)
        {
            try
            {
                if (attendeeDTO == null)
                {
                    return(BadRequest(new ApiResponse {
                        Status = false, Message = "Bad Request"
                    }));
                }

                await _attendeeService.AddAttendeeAsynce(attendeeDTO);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message, $"Failed to add Attendee: {DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fff")}");
            }
            _logger.LogInformation("Attendee was successfully added");
            return(Created("", new ApiResponse {
                Status = true, Message = "Successful"
            }));
        }