/// <summary>
 /// Create a new CredentialAppService instance
 /// </summary>
 /// <param name="provider">DIP Service provider</param>
 /// <param name="rsApiOptions">RSoft Api options parameters object</param>
 /// <param name="localizer">Language localizer string</param>
 public CredentialAppService
 (
     IServiceProvider provider,
     IOptions <RSApiOptions> rsApiOptions,
     IOptions <PagesOptions> pagesOptions,
     IStringLocalizer <AppResource> localizer
 )
 {
     _userDomain   = provider.GetService <IUserDomainService>();
     _apiOptions   = rsApiOptions?.Value;
     _pagesOptions = pagesOptions?.Value;
     _jsonOptions  = new JsonSerializerOptions()
     {
         PropertyNameCaseInsensitive = true
     };
     _localizer = localizer;
 }
        /// <summary>
        /// Adds points to application health checks
        /// </summary>
        /// <param name="services">Services collection object</param>
        /// <param name="configuration">Configuration object</param>
        public static IServiceCollection AddApplicationHealthChecks(this IServiceCollection services, IConfiguration configuration)
        {
            var apiOptions = new RSApiOptions();

            configuration.GetSection("Application:RSoftApis").Bind(apiOptions);

            services.AddHealthChecks()
            .AddUrlGroup(
                new Uri(apiOptions.Uri),
                name: "Access the Email Sending API",
                failureStatus: HealthStatus.Degraded,
                tags: new string[] { "rsoft.mail.service" })
            .AddMySql(
                connectionString: configuration.GetValue <string>("ConnectionStrings:DbServer"),
                name: "MySqlDb",
                failureStatus: HealthStatus.Unhealthy,
                timeout: TimeSpan.FromSeconds(15),
                tags: new string[] { "mysqldb" })

            ;

            return(services);
        }