Beispiel #1
0
 public DrinkController(IDrinkService drinkService,
                        ISearchService searchService,
                        IResponseService responseService)
 {
     this.drinkService    = drinkService;
     this.responseService = responseService;
 }
Beispiel #2
0
        /// <summary>
        /// Gets the response service client
        /// </summary>
        /// <returns>returns the response service client</returns>
        public override IResponseService GetResponseServiceClient()
        {
            ICommunicationObject getResponsesChannel = this.responseServiceClient as ICommunicationObject;

            if (this.responseServiceClient == null || (getResponsesChannel != null && getResponsesChannel.State == CommunicationState.Faulted))
            {
                lock (this.lockCreateChannel)
                {
                    // if responseServiceClient is in Faulted state, recreate it
                    if (getResponsesChannel != null && getResponsesChannel.State == CommunicationState.Faulted)
                    {
                        SessionBase.TraceSource.TraceInformation("ResponseServiceClient is in Faulted state. Recreate it.");
                        Utility.SafeCloseCommunicateObject(getResponsesChannel);
                        this.responseServiceClient = null;
                    }

                    if (this.responseServiceClient == null)
                    {
                        // For Azure connection, the Azure broker sends back heartbeat message for this client.
                        this.responseServiceClient = this.CreateClientWithRetry(ClientType.GetResponse) as BrokerResponseServiceClient;
                    }
                }
            }

            return(this.responseServiceClient);
        }
 public ProductController(
     IProductService productService,
     IResponseService responseService)
 {
     _productService  = productService ?? throw new ArgumentNullException(nameof(productService));
     _responseService = responseService ?? throw new ArgumentNullException(nameof(responseService));
 }
 public UserRoleService(UserManager <ApplicationUser> userManager, IResponseService <ApplicationUserDto> responseService, IMapper mapper, IRoleService roleService)
 {
     _userManager     = userManager;
     _responseService = responseService;
     _mapper          = mapper;
     _roleService     = roleService;
 }
 public OrderedProductController(
     IOrderedProductService orderedProductService,
     IResponseService responseService)
 {
     _orderedProductService = orderedProductService ?? throw new ArgumentNullException(nameof(orderedProductService));
     _responseService       = responseService ?? throw new ArgumentNullException(nameof(responseService));
 }
Beispiel #6
0
 public ServeService(IContactService contactService,
                     IContactRelationshipService contactRelationshipService,
                     IOpportunityService opportunityService,
                     MinistryPlatform.Translation.Services.Interfaces.IEventService eventService,
                     IParticipantService participantService,
                     IGroupParticipantService groupParticipantService,
                     IGroupService groupService,
                     ICommunicationService communicationService,
                     IAuthenticationService authenticationService,
                     IConfigurationWrapper configurationWrapper,
                     IApiUserService apiUserService,
                     IResponseService responseService)
 {
     _contactService = contactService;
     _contactRelationshipService = contactRelationshipService;
     _opportunityService = opportunityService;
     _eventService = eventService;
     _participantService = participantService;
     _groupParticipantService = groupParticipantService;
     _groupService = groupService;
     _communicationService = communicationService;
     _authenticationService = authenticationService;
     _configurationWrapper = configurationWrapper;
     _apiUserService = apiUserService;
     _responseService = responseService;
 }
 public ResponseController(
     IResponseService responseService,
     ILogger<ResponseController> logger)
 {
     _responseService = responseService;
     _logger = logger;
 }
        internal async Task <IResponseService> CloseBet(int idGame)
        {
            try
            {
                Game gameResponse = await GetGame(idGame);

                if (gameResponse != null && gameResponse.Id > 0 && gameResponse.Enabled)
                {
                    gameResponse = await SendAndCloseDataGame(gameResponse);

                    IResponseService getListGame = await _betsService.GetByIdGame(idGame);
                    await UpdateDataWinningBets(gameResponse, getListGame);

                    return(getListGame);
                }
                else
                {
                    throw new ArgumentException(MessagesEnum.GameNotAvailable);
                }
            }
            catch (Exception ex)
            {
                _responseService.Meta.Errors.Add(_exceptionHandler.GetMessage(ex));
                _responseService.Meta.HttpStatus = MessagesEnum.HttpStateBadRequest;
                return(_responseService);
            }
        }
Beispiel #9
0
 public LoginService(SignInManager <ApplicationUser> signInManager, UserManager <ApplicationUser> userManager, ITokenService tokenService, IResponseService <LoginResultDto> responseService)
 {
     _signInManager   = signInManager;
     _userManager     = userManager;
     _tokenService    = tokenService;
     _responseService = responseService;
 }
 public DynamicDialogDialog(IResponseService responseService)
 {
     //set the language based on the users chat app preferences
     SetLanguageBasedOnThread();
     //register the response service
     SetField.NotNull(out _responseService, nameof(responseService), responseService);
 }
 public LedgerService(ILegerRepository legerRepository, IMapper mapper, IResponseService <LedgerDto> responseService, IUnitOfWork unitOfWork)
 {
     _legerRepository = legerRepository;
     _responseService = responseService;
     _unitOfWork      = unitOfWork;
     _mapper          = mapper;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="SqsRequestMessageRelay" /> class.
        /// </summary>
        /// <param name="sqs">Client for Amazon SQS.</param>
        /// <param name="completeQueue">Queue to put completed messages in.</param>
        /// <param name="failQueue">Queue to put failed messages in.</param>
        /// <param name="serializer">Service for serialization/deserialization of messages.</param>
        /// <param name="options">Options to use for requests.</param>
        /// <param name="responseService">Service used for handling responses.</param>
        /// <param name="httpClient">HTTP Client to use for responding to requests.</param>
        /// <param name="logger">Logger used to log information to some destination(s).</param>
        public SqsRequestMessageRelay(
            IAmazonSQS sqs,
            IChannel <RequestMessage> completeQueue,
            IChannel <RequestMessage> failQueue,
            ISerializer serializer,
            IOptions <RequestOptions> options,
            IResponseService responseService,
            IRequestMessageRelayHttpClient httpClient,
            ILogger <SqsRequestMessageRelay> logger
            )
        {
            this.sqs             = sqs;
            this.completeQueue   = completeQueue;
            this.failQueue       = failQueue;
            this.serializer      = serializer;
            this.options         = options.Value;
            this.responseService = responseService;
            this.httpClient      = httpClient;
            this.logger          = logger;

            source = new CancellationTokenSource();
            workerCancellationToken = source.Token;
            receiveMessageRequest   = new ReceiveMessageRequest
            {
                QueueUrl            = this.options.QueueUrl.ToString(),
                MaxNumberOfMessages = (int)this.options.MessageBufferSize,
                WaitTimeSeconds     = this.options.MessageWaitTime,
            };

            Run();
        }
Beispiel #13
0
 public GetTokenService(IBaseHttpClient http, IResponseService responseService)
 {
     _http = http
             ?? throw new ArgumentNullException(nameof(http));
     _responseService = responseService
                        ?? throw new ArgumentNullException(nameof(responseService));
 }
 public IndexModel(
     IWinnerService winnerService,
     IResponseService responseService)
 {
     _winnerService   = winnerService;
     _responseService = responseService;
 }
Beispiel #15
0
 public CreateSurveyController(ISurveyService surveyService, IQuestionService questionService, IResponseService responseService, IUserService userService)
 {
     this.surveyService   = surveyService;
     this.questionService = questionService;
     this.responseService = responseService;
     this.userService     = userService;
 }
Beispiel #16
0
 public FindingController(IResponseService service)
 {
     if (service == null)
     {
         throw new ArgumentNullException("No response service");
     }
     responseService = service;
 }
        public ResetPasswordVm(IAccountService accountService, NavigationManager navigationManager, IResponseService responseService)
        {
            _accountService    = accountService;
            _navigationManager = navigationManager;
            _responseService   = responseService;

            notification = new NotificationModel();
        }
Beispiel #18
0
 public MessageService(ILogger <MessageService> logger, IResponseService responseService,
                       IRequestService requestService, IMediaPlayer mediaPlayer)
 {
     this.logger          = logger;
     this.responseService = responseService;
     this.requestService  = requestService;
     this.mediaPlayer     = mediaPlayer;
 }
Beispiel #19
0
        public ResponseListViewModel(IResponseService service)
        {
            _responseService = service;

            DeleteResponse = new DelegateCommand(DeleteResponseAction, CanUpdateOrDelete);
            AddResponse    = new DelegateCommand(AddResponseAction);
            UpdateResponse = new DelegateCommand(UpdateResponseAction, CanUpdateOrDelete);
        }
Beispiel #20
0
        public GroupInfoVm(IResponseService responseService, IRepository repository)
        {
            _responseService = responseService;
            _repository      = repository;

            notification = new NotificationModel();
            item         = new GetGroupByIdVm();
        }
 public GroupLedgerService(IMapper mapper, IResponseService <GroupLedgerDto> responseService, IUnitOfWork unitOfWork,
                           IGroupLedgerRepository groupLedgerRepository)
 {
     _responseService       = responseService;
     _unitOfWork            = unitOfWork;
     _groupLedgerRepository = groupLedgerRepository;
     _mapper = mapper;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ResponseController" /> class.
 /// </summary>
 /// <param name="responseService">Service for handling responses.</param>
 /// <param name="logger">Logger used to log info to some destination(s).</param>
 public ResponseController(
     IResponseService responseService,
     ILogger <ResponseController> logger
     )
 {
     this.responseService = responseService;
     this.logger          = logger;
 }
Beispiel #23
0
 public OrderService(IUnitOfWork unitOfWork, IMapper mapper, IResponseService responseService, IUserService userService, IItemService itemService)
 {
     UnitOfWork      = unitOfWork;
     Mapper          = mapper;
     ResponseService = responseService;
     UserService     = userService;
     ItemService     = itemService;
 }
Beispiel #24
0
 public ExceptionApp(string message, IResponseService response = null) : base(message.IsNullOrWhiteSpace()
     ? response?.ServerContent?.Item1
     : message)
 {
     _message = message;
     Response = response;
     Source   = response?.ServerContent?.Item1;
 }
Beispiel #25
0
 public ProcessMeterService(IResponseService responseService, IBaseHttpClient http, IConfiguration config)
 {
     _http            = http ?? throw new ArgumentNullException(nameof(http));
     _responseService = responseService
                        ?? throw new ArgumentNullException(nameof(responseService));
     _configuration = config
                      ?? throw new ArgumentNullException(nameof(config));
 }
Beispiel #26
0
        private async Task UpdateDataWinningBets(Game gameResponse, IResponseService getListGame)
        {
            List <Bet> listBet          = listBetByIdGame(getListGame);
            var        winnerNumberList = listBet.Where(x => x.Number == gameResponse.WinningNumber).ToList();
            var        winnerColorList  = listBet.Where(x => x.Color == gameResponse.WinningColor).ToList();

            UpdateDataWinningBets(winnerNumberList, 5);
            UpdateDataWinningBets(winnerColorList, 1.8);
        }
Beispiel #27
0
 public TokenController(
     IJwtService jwtService,
     Func <GrantType, IHandler> handlerFactory,
     IResponseService responseService)
 {
     _jwtService      = jwtService;
     _handlerFactory  = handlerFactory;
     _responseService = responseService;
 }
Beispiel #28
0
        public JoinGroupVm(IResponseService responseService, IRepository repository, ICurrentUserService currentUser, NavigationManager navigationManager)
        {
            _responseService   = responseService;
            _repository        = repository;
            _currentUser       = currentUser;
            _navigationManager = navigationManager;

            notification = new NotificationModel();
        }
 public UserController(
     IUserRepository userRepository,
     IPasswordService passwordService,
     IResponseService responseService)
 {
     _userRepository  = userRepository;
     _passwordService = passwordService;
     _responseService = responseService;
 }
 public OrderController(
     IOrderService orderService,
     IEmailService emailService,
     IResponseService responseService)
 {
     _orderService    = orderService ?? throw new ArgumentNullException(nameof(orderService));
     _emailService    = emailService ?? throw new ArgumentNullException(nameof(emailService));
     _responseService = responseService ?? throw new ArgumentNullException(nameof(responseService));
 }
Beispiel #31
0
        public LoginVm(IAccountService accountService, NavigationManager navigationManager, IResponseService responseService)
        {
            _accountService    = accountService;
            _navigationManager = navigationManager;
            _responseService   = responseService;

            item         = new LoginModel();
            notification = new NotificationModel();
        }
 public SurveysController(
     ISurveyService surveyService,
     IUserService userService,
     IQuestionService questionService,
     IResponseService responseService)
     : base(userService, surveyService)
 {
     this.questionService = questionService;
     this.responseService = responseService;
 }