示例#1
0
        public UpdateHandler(ILogger log, IConfigProvider config,
                             IErrorResponseFactory errorResponseFactory,
                             IUntappdApiClient client) : base(log,
                                                              config, errorResponseFactory)
        {
            this.client = client;

            SupportedActions.Add(HttpMethod.Get, GetAction);
        }
        public ReviewHandler(ILogger log, IConfigProvider config, IErrorResponseFactory errorResponseFactory,
                             IUserBeerRankingRepo beerRankingRepo) : base(log, config, errorResponseFactory)
        {
            this.beerRankingRepo = beerRankingRepo;

            SupportedActions.Add(HttpMethod.Get, GetAction);
            SupportedActions.Add(HttpMethod.Post, PostAction);

            SetupDocumentation();
        }
        public UserHandler(ILogger log, IConfigProvider config,
                           IErrorResponseFactory errorResponseFactory,
                           IUserInfoRepo userRepo) : base(log,
                                                          config, errorResponseFactory)
        {
            this.userRepo = userRepo;

            SupportedActions.Add(HttpMethod.Get, GetAction);
            SupportedActions.Add(HttpMethod.Post, PostAction);

            SetupDocumentation();
        }
        public BreweryHandler(ILogger log, IConfigProvider config,
                              IErrorResponseFactory errorResponseFactory,
                              IBreweryRepo breweryRepo, IUntappdApiClient client) : base(log, config,
                                                                                         errorResponseFactory)
        {
            this.breweryRepo = breweryRepo;

            this.client = client;

            SupportedActions.Add(HttpMethod.Get, GetAction);
            SupportedActions.Add(HttpMethod.Post, PostAction);

            SetupDocumentation();
        }
示例#5
0
        virtual protected void updateCapabilities()
        {
            //
            var saList = getRestProperty <List <string> >($"SupportedActions");

            //var currList = SupportedActions.ToList();
            //SupportedActions automatically enumerated by Except before operating on it...
            foreach (var sa in saList.Except(SupportedActions.ToStrings()))
            {
                SupportedActions.Add(sa);
            }
            //MUST enumerate actions before operating on it...
            foreach (var sa in SupportedActions.ToStrings().Except(saList).ToList())
            {
                SupportedActions.Remove(sa);
            }
        }
 public RobotHandler(ILogger log, IConfigProvider config, IErrorResponseFactory errorResponseFactory) : base(log,
                                                                                                             config, errorResponseFactory)
 {
     SupportedActions.Add(HttpMethod.Get, GetAction);
 }