Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <param name="args">Encapsulates the properties to initialize a new
        /// ApiServiceArgs&lt;TLoggerCategory&gt;.</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));
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the class.
 /// </summary>
 /// <param name="args">Encapsulates the properties to initialize a new
 /// ApiService&lt;TLoggerCategory&gt;.</param>
 public ApiServiceEF(ApiServiceArgs <TLoggerCategory> args)
     : base(args)
 {
 }