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(); }
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)); } }
public StatusBuilder(IRestApiWrapper wrapper, IJsonConfiguration config) // ctor { _api = wrapper; _config = config; _logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); }
public void Initialize() { _api = new RestApiWrapper(new HttpClient(), new JsonConfiguration()); _config = new JsonConfiguration(); _repository = new Repository(); }
public TemplateFieldBuilder(IRestApiWrapper wrapper, IJsonConfiguration config) { _api = wrapper; // ctor _config = config; _logger = NLog.Web.NLogBuilder.ConfigureNLog("nlog.config").GetCurrentClassLogger(); }