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; }
private ExceptionsDataLoadParams GetExceptionsDataLoadParams(IDbContext context, ExceptionsSettings settings) { var loadParams = new ExceptionsDataLoadParams(context, settings) { Version = this.Version, TimePeriod = this.TimePeriod }; return loadParams; }
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(); } }
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)); } }
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); } }
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; }