Created
September 24, 2021 18:16
-
-
Save DocGreenRob/c0531afd4a3377b07d690fe23fb4df65 to your computer and use it in GitHub Desktop.
BaseController Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Cge.Core.Extensions; | |
using Cge.Core.Logging; | |
using Cge.Core.Models; | |
using HomeaZZon.Common.Dto; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Primitives; | |
namespace HomeaZZon.Api.Controllers | |
{ | |
public abstract class BaseController : ControllerBase | |
{ | |
public BaseController(ITelemetryClient telemetryClient, IConfiguration configuration, IApplicationContext applicationContext) | |
{ | |
TelemetryClient = telemetryClient.ValidateArgNotNull(nameof(telemetryClient)); | |
Configuration = configuration.ValidateArgNotNull(nameof(configuration)); | |
ApplicationContext = applicationContext.ValidateArgNotNull(nameof(applicationContext)); | |
} | |
public IApplicationContext ApplicationContext { get; } | |
public IConfiguration Configuration { get; } | |
public ITelemetryClient TelemetryClient { get; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment