protected MsSqlWatcherCheckResult(MsSqlWatcher watcher, bool isValid, string description, string connectionString, string query, IEnumerable <dynamic> queryResult) : base(watcher, isValid, description) { ConnectionString = connectionString; Query = query; QueryResult = queryResult; }
/// <summary> /// Extension method for adding the MSSQL watcher to the the WardenConfiguration. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="name">Name of the MsSqlWatcher.</param> /// <param name="connectionString">Connection string of the MSSQL database.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddMsSqlWatcher( this WardenConfiguration.Builder builder, string name, string connectionString, Action <WatcherHooksConfiguration.Builder> hooks = null) { builder.AddWatcher(MsSqlWatcher.Create(connectionString), hooks); return(builder); }
/// <summary> /// Extension method for adding the MSSQL watcher to the the WardenConfiguration with the default name of MSSQL Watcher. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddMsSqlWatcher( this WardenConfiguration.Builder builder, MsSqlWatcherConfiguration configuration, Action <WatcherHooksConfiguration.Builder> hooks = null) { builder.AddWatcher(MsSqlWatcher.Create(configuration), hooks); return(builder); }
/// <summary> /// Extension method for adding the MSSQL watcher to the the WardenConfiguration with the default name of MSSQL Watcher. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="connectionString">Connection string of the MSSQL database.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <param name="interval">Optional interval (5 seconds by default) after which the next check will be invoked.</param> /// <param name="group">Optional name of the group that MsSqlWatcher belongs to.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddMsSqlWatcher( this WardenConfiguration.Builder builder, string connectionString, Action <WatcherHooksConfiguration.Builder> hooks = null, TimeSpan?interval = null, string group = null) { builder.AddWatcher(MsSqlWatcher.Create(connectionString, group: group), hooks, interval); return(builder); }
/// <summary> /// Extension method for adding the MSSQL watcher to the the WardenConfiguration. /// </summary> /// <param name="builder">Instance of the Warden configuration builder.</param> /// <param name="name">Name of the MsSqlWatcher.</param> /// <param name="configuration">Configuration of MsSqlWatcher.</param> /// <param name="hooks">Optional lambda expression for configuring the watcher hooks.</param> /// <param name="interval">Optional interval (5 seconds by default) after which the next check will be invoked.</param> /// <returns>Instance of fluent builder for the WardenConfiguration.</returns> public static WardenConfiguration.Builder AddMsSqlWatcher( this WardenConfiguration.Builder builder, string name, MsSqlWatcherConfiguration configuration, Action <WatcherHooksConfiguration.Builder> hooks = null, TimeSpan?interval = null) { builder.AddWatcher(MsSqlWatcher.Create(name, configuration), hooks, interval); return(builder); }
/// <summary> /// Factory method for creating a new instance of MsSqlWatcherCheckResult. /// </summary> /// <param name="watcher">Instance of MsSqlWatcher.</param> /// <param name="isValid">Flag determining whether the performed check was valid.</param> /// <param name="connectionString">Connection string of the MSSQL server.</param> /// <param name="query">SQL query.</param> /// <param name="queryResult">Collection of dynamic results of the SQL query.</param> /// <param name="description">Custom description of the performed check.</param> /// <returns>Instance of MsSqlWatcherCheckResult.</returns> public static MsSqlWatcherCheckResult Create(MsSqlWatcher watcher, bool isValid, string connectionString, string query, IEnumerable <dynamic> queryResult, string description = "") => new MsSqlWatcherCheckResult(watcher, isValid, description, connectionString, query, queryResult);
/// <summary> /// Factory method for creating a new instance of MsSqlWatcherCheckResult. /// </summary> /// <param name="watcher">Instance of MsSqlWatcher.</param> /// <param name="isValid">Flag determining whether the performed check was valid.</param> /// <param name="connectionString">Connection string of the MSSQL server.</param> /// <param name="description">Custom description of the performed check.</param> /// <returns>Instance of MsSqlWatcherCheckResult.</returns> public static MsSqlWatcherCheckResult Create(MsSqlWatcher watcher, bool isValid, string connectionString, string description = "") => new MsSqlWatcherCheckResult(watcher, isValid, description, connectionString, string.Empty, Enumerable.Empty <dynamic>());