/// <summary> /// Unregister all applications and endpoints /// </summary> /// <param name="service"></param> /// <returns></returns> public static async Task UnregisterAllApplicationsAsync( this IApplicationRegistry service) { var apps = await service.ListAllApplicationsAsync(); foreach (var app in apps) { await Try.Async(() => service.UnregisterApplicationAsync( app.ApplicationId)); } }
/// <summary> /// Unregister all applications and endpoints /// </summary> /// <param name="service"></param> /// <param name="ct"></param> /// <returns></returns> public static async Task UnregisterAllApplicationsAsync( this IApplicationRegistry service, CancellationToken ct = default) { var apps = await service.ListAllApplicationsAsync(ct); foreach (var app in apps) { await Try.Async(() => service.UnregisterApplicationAsync( app.ApplicationId, null, ct)); } }
/// <summary> /// List all application registrations /// </summary> /// <param name="service"></param> /// <returns></returns> public static async Task <List <ApplicationRegistrationModel> > ListAllRegistrationsAsync( this IApplicationRegistry service) { var registrations = new List <ApplicationRegistrationModel>(); var infos = await service.ListAllApplicationsAsync(); foreach (var info in infos) { var registration = await service.GetApplicationAsync(info.ApplicationId); registrations.Add(registration); } return(registrations); }
/// <summary> /// List all application registrations /// </summary> /// <param name="service"></param> /// <param name="ct"></param> /// <returns></returns> public static async Task <List <ApplicationRegistrationModel> > ListAllRegistrationsAsync( this IApplicationRegistry service, CancellationToken ct = default) { var registrations = new List <ApplicationRegistrationModel>(); var infos = await service.ListAllApplicationsAsync(ct); foreach (var info in infos) { var registration = await service.GetApplicationAsync(info.ApplicationId, false, ct); registrations.Add(registration); } return(registrations); }