public ExceptionsDataLoadParams(IDbContext context, ExceptionsSettings settings)
        {
            if (context == null) throw new ArgumentNullException(nameof(context));
            if (settings == null) throw new ArgumentNullException(nameof(settings));

            this.Context = context;
            this.Settings = settings;
        }
Exemple #2
0
		private ExceptionsDataLoadParams GetExceptionsDataLoadParams(IDbContext context, ExceptionsSettings settings)
		{
			var loadParams = new ExceptionsDataLoadParams(context, settings)
			{
				Version = this.Version,
				TimePeriod = this.TimePeriod
			};
			return loadParams;
		}
Exemple #3
0
		private void LoadCurrentExceptionData(ExceptionsSettings settings = null)
		{
			if (!this.IsLoaded) return;

			using (var ctx = this.DbContextCreator())
			{
				this.LoadExceptions(ctx, settings);
				this.LoadExceptionsCounts(ctx, settings);

				ctx.Complete();
			}
		}
Exemple #4
0
		private void LoadExceptionsCounts(IDbContext context, ExceptionsSettings settings = null)
		{
			this.ExceptionsCounts.Clear();

			foreach (var exceptionsCount in this.ExceptionsCountProvider(this.GetExceptionsDataLoadParams(context, settings ?? this.Settings)))
			{
				this.ExceptionsCounts.Add(new ExceptionsCountViewModel(exceptionsCount));
			}
		}
Exemple #5
0
		private void LoadExceptions(IDbContext context, ExceptionsSettings settings = null)
		{
			this.LatestExceptions.Clear();

			foreach (var featureException in this.ExceptionsProvider(this.GetExceptionsDataLoadParams(context, settings ?? this.Settings)))
			{
				this.LatestExceptions.Add(featureException);
			}
		}
Exemple #6
0
		public ExceptionsViewModel(Func<IDbContext> dbContextCreator, ExceptionsSettings settings)
		{
			if (dbContextCreator == null) throw new ArgumentNullException(nameof(dbContextCreator));
			if (settings == null) throw new ArgumentNullException(nameof(settings));

			this.DbContextCreator = dbContextCreator;
			this.Settings = settings;
		}