コード例 #1
0
        public async Task <IActionResult> Update([FromBody] entity.Visitor visitor)
        {
            ISingleModelResponse <entity.Visitor> response = new SingleModelResponse <entity.Visitor>();

            try
            {
                response.Model = await _visitorRepository.EditVisitor(visitor);

                response.Message = "Updated Information successfully";
            }
            catch (Exception ex)
            {
                _logger.LogInformation(entities.LoggingEvents.UpdateItem, "Exception:{0}", ex);

                response.IsError      = true;
                response.ErrorMessage = "Some Error occured, Please contact to Administrator";
                return(BadRequest(response));
            }

            return(Ok(response));
        }