/// <summary> /// Initializes a new instance of the <see cref="BaseDataAccess" /> class. /// </summary> /// <param name="errorHelper">The error helper.</param> /// <param name="benchmarkHelper">The benchmark helper.</param> /// <exception cref="System.ArgumentNullException"> /// Exception thrown if either of the helpers are null. /// </exception> protected BaseDataAccess(IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper) { if (errorHelper == null) { throw new ArgumentNullException(nameof(errorHelper)); } this.errorHelper = errorHelper; if (benchmarkHelper == null) { throw new ArgumentNullException(nameof(benchmarkHelper)); } this.benchmarkHelper = benchmarkHelper; var context = HttpContext.Current.GetOwinContext(); var user = context.Authentication.User; var claim = user.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier); client = new HttpClient { BaseAddress = new Uri(WebConfigurationManager.AppSettings.Get("ApiUri")) }; client.DefaultRequestHeaders.Clear(); if (claim != null) { client.DefaultRequestHeaders.Add("USER_ID", claim.Value); } client.DefaultRequestHeaders.Add("API_KEY", WebConfigurationManager.AppSettings.Get("ApiKey")); }
/// <summary> /// Initializes a new instance of the <see cref="BillController"/> class. /// </summary> /// <param name="orchestrator"> /// The orchestrator. /// </param> /// <param name="benchmarkHelper"> /// The benchmark helper. /// </param> /// <exception cref="System.ArgumentNullException"> /// Exception thrown when the orchestrator is null. /// </exception> public BillController(IBillOrchestrator orchestrator, IBenchmarkHelper benchmarkHelper) : base(benchmarkHelper) { if (orchestrator == null) { throw new ArgumentNullException(nameof(orchestrator)); } this.orchestrator = orchestrator; }
/// <summary> /// Initializes a new instance of the <see cref="BaseController" /> class. /// </summary> /// <param name="benchmarkHelper">The benchmark helper.</param> /// <exception cref="System.ArgumentNullException"> /// benchmarkHelper /// Exception thrown if the benchmark helper is null. /// </exception> public BaseController(IBenchmarkHelper benchmarkHelper) { if (benchmarkHelper == null) { throw new ArgumentNullException(nameof(benchmarkHelper)); } this.benchmarkHelper = benchmarkHelper; }
/// <summary> /// Initializes a new instance of the <see cref="ExpenditureChartController"/> class. /// </summary> /// <param name="orchestrator"> /// The orchestrator. /// </param> /// <param name="benchmarkHelper"> /// The benchmark helper. /// </param> /// <exception cref="System.ArgumentNullException"> /// orchestrator /// Exception thrown if the orchestrator is null. /// </exception> public ExpenditureChartController(IChartOrchestrator orchestrator, IBenchmarkHelper benchmarkHelper) : base(benchmarkHelper) { if (orchestrator == null) { throw new ArgumentNullException(nameof(orchestrator)); } this.orchestrator = orchestrator; }
/// <summary> /// Initializes a new instance of the <see cref="GoalController" /> class. /// </summary> /// <param name="orchestrator"> /// The orchestrator. /// </param> /// <param name="errorHelper"> /// The error helper. /// </param> /// <param name="benchmarkHelper"> /// The benchmark helper. /// </param> /// <param name="viewHelper"> /// The view helper. /// </param> /// <exception cref="System.ArgumentNullException"> /// Exception thrown if the orchestrator is null. /// </exception> public GoalController( IGoalOrchestrator orchestrator, IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper, IViewHelper viewHelper) : base(errorHelper, benchmarkHelper, viewHelper) { if (orchestrator == null) { throw new ArgumentNullException(nameof(orchestrator)); } this.orchestrator = orchestrator; }
/// <summary> /// Initializes a new instance of the <see cref="ExpenditureController" /> class. /// </summary> /// <param name="orchestrator"> /// The orchestrator. /// </param> /// <param name="chartOrchestrator"> /// The chart orchestrator. /// </param> /// <param name="errorHelper"> /// The error helper. /// </param> /// <param name="benchmarkHelper"> /// The benchmark helper. /// </param> /// <param name="viewHelper"> /// The view helper. /// </param> /// <exception cref="System.ArgumentNullException"> /// Exception thrown if the chart or expenditure orchestrator are null. /// </exception> public ExpenditureController( IExpenditureOrchestrator orchestrator, IChartOrchestrator chartOrchestrator, IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper, IViewHelper viewHelper) : base(errorHelper, benchmarkHelper, viewHelper) { if (orchestrator == null) { throw new ArgumentNullException(nameof(orchestrator)); } if (chartOrchestrator == null) { throw new ArgumentNullException(nameof(chartOrchestrator)); } this.orchestrator = orchestrator; this.chartOrchestrator = chartOrchestrator; }
/// <summary> /// Initializes a new instance of the <see cref="BaseController" /> class. /// </summary> /// <param name="errorHelper"> /// The error helper. /// </param> /// <param name="benchmarkHelper"> /// The benchmark helper. /// </param> /// <param name="viewHelper"> /// The view helper. /// </param> /// <exception cref="ArgumentNullException"> /// Exception thrown if any of the given parameters are null. /// </exception> public BaseController(IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper, IViewHelper viewHelper) { if (errorHelper == null) { throw new ArgumentNullException(nameof(errorHelper)); } if (benchmarkHelper == null) { throw new ArgumentNullException(nameof(errorHelper)); } if (viewHelper == null) { throw new ArgumentNullException(nameof(viewHelper)); } this.errorHelper = errorHelper; this.benchmarkHelper = benchmarkHelper; ViewHelper = viewHelper; }
/// <summary> /// Initializes a new instance of the <see cref="BillDataAccess"/> class. /// </summary> /// <param name="errorHelper">The error helper.</param> /// <param name="benchmarkHelper">The benchmark helper.</param> public BillDataAccess(IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper) : base(errorHelper, benchmarkHelper) { }
/// <summary> /// Initializes a new instance of the <see cref="BudgetController" /> class. /// </summary> /// <param name="errorHelper">The error helper.</param> /// <param name="benchmarkHelper">The benchmark helper.</param> /// <param name="viewHelper">The view helper.</param> public BudgetController(IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper, IViewHelper viewHelper) : base(errorHelper, benchmarkHelper, viewHelper) { }
/// <summary> /// Initializes a new instance of the <see cref="ExpenditureDataAccess"/> class. /// </summary> /// <param name="errorHelper">The error helper.</param> /// <param name="benchmarkHelper">The benchmark helper.</param> public ExpenditureDataAccess(IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper) : base(errorHelper, benchmarkHelper) { }
/// <summary> /// Initializes a new instance of the <see cref="ResourceController" /> class. /// </summary> /// <param name="errorHelper">The error helper.</param> /// <param name="benchmarkHelper">The benchmark helper.</param> /// <param name="viewHelper">The view helper.</param> public ResourceController(IErrorHelper errorHelper, IBenchmarkHelper benchmarkHelper, IViewHelper viewHelper) : base(errorHelper, benchmarkHelper, viewHelper) { }