feat(IAuthClient): IsConnected, ConnectionError und ConnectionError Eigenschaften hinzugefügt.

- Umwandlung der Eigenschaft IsConnectionFailed in eine Erweiterungsmethode.
This commit is contained in:
Developer 02 2025-02-03 16:38:22 +01:00
parent 31ccd93b0d
commit cfe5df4b1d
3 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,6 @@
namespace DigitalData.Auth.Abstractions;
public static class ClientExtensions
{
public static bool IsConnectionFailed(this IAuthClient client) => client.ConnectionError is not null;
}

View File

@ -2,6 +2,12 @@
public interface IAuthClient : IAuthClientHandler
{
bool IsConnected { get; }
Exception? ConnectionError { get; }
bool IsConnectionFailed => ConnectionError is not null;
Task StartAsync();
Task<bool> TryStartAsync();

View File

@ -47,8 +47,6 @@ public class AuthClient : IAuthClient
public Exception? ConnectionError { get; private set; }
public bool IsConnectionFailed => ConnectionError is not null;
public async Task StartAsync() => await _lazyInitiator.Value;
public async Task<bool> TryStartAsync()