コード例 #1
0
        public IHttpActionResult GetAll()
        {
            try
            {
                ItemsResponse <AddressType> response = new ItemsResponse <AddressType>();
                response.Items = _addressTypeService.ReadAll();
                return(Ok(response));
            }
            catch (Exception ex)
            {
                int currentUser = _userService.GetCurrentUserId();
                _appLogService.Insert(new AppLogAddRequest
                {
                    AppLogTypeId = 1,
                    Message      = ex.Message,
                    StackTrace   = ex.StackTrace,
                    Title        = "Error in " + GetType().Name + " " + System.Reflection.MethodBase.GetCurrentMethod().Name,
                    UserBaseId   = currentUser
                });

                return(BadRequest(ex.Message));
            }
        }