Пример #1
0
 public SignatureBuilder(IRestApiWrapper wrapper, IJsonConfiguration config, IRepository repository)
 {
     _api        = wrapper;
     _config     = config;
     _repository = repository;
     _repository.InitializeContext(_config.ConnectionString);
     _logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
 }
Пример #2
0
        public IActionResult GetAccount([FromServices] IRestApiWrapper api)
        {
            try
            {
                string username, password;
                ExtractHeaderValues(Request.Headers, out username, out password);

                string accountId = api.GetAccountId(username, password);

                Response response = new Response("accountId", accountId);
                response.Meta.Add("status", "200");
                return(ResultFormatter.Format(200, response));
            }
            catch (Exception exc)
            {
                _logger.Error(exc, "GET account");
                return(ResultFormatter.Format(500, exc));
            }
        }
Пример #3
0
 public StatusBuilder(IRestApiWrapper wrapper, IJsonConfiguration config)   // ctor
 {
     _api    = wrapper;
     _config = config;
     _logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
 }
Пример #4
0
 public void Initialize()
 {
     _api        = new RestApiWrapper(new HttpClient(), new JsonConfiguration());
     _config     = new JsonConfiguration();
     _repository = new Repository();
 }
Пример #5
0
 public TemplateFieldBuilder(IRestApiWrapper wrapper, IJsonConfiguration config)
 {
     _api    = wrapper;                  // ctor
     _config = config;
     _logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger();
 }