/// <summary> /// Initializes a new instance of the class. /// </summary> /// <param name="args">Encapsulates the properties to initialize a new /// ApiServiceArgs<TLoggerCategory>.</param> /// <exception cref="ArgumentNullException">Args is null.</exception> public ApiService(ApiServiceArgs <TLoggerCategory> args) { if (args == null) { throw new ArgumentNullException( UtilResources.Get("ArgumentCanNotBeNull", nameof(args))); } _stopWatch = new Stopwatch(); _httpContextAccessor = args.HttpContextAccessor; ServiceProvider = args.ServiceProvider; Config = args.Config; Logger = args.Logger; Mapper = args.Mapper; UtilResources.Initialize(args.StringLocalizerFactory); _stringLocalizer = UtilResources.Factory.Create(typeof(TResources)); }
/// <summary> /// Initializes a new instance of the class. /// </summary> /// <param name="args">Encapsulates the properties to initialize a new /// ApiService<TLoggerCategory>.</param> public ApiServiceEF(ApiServiceArgs <TLoggerCategory> args) : base(args) { }