This commit is contained in:
CortexCore
2025-03-03 18:44:00 +08:00
parent 561974a1ea
commit c29bf0d12f
84 changed files with 3986 additions and 1027 deletions

View File

@@ -17,8 +17,7 @@ namespace BITKit.Entities
throw new NotImplementedException();
}
public int Id { get; set; } = Guid.NewGuid().GetHashCode();
public CancellationToken CancellationToken => _cancellationTokenSource.Token;
private readonly CancellationTokenSource _cancellationTokenSource = new();
public CancellationToken CancellationToken { get; set; }
public IServiceProvider ServiceProvider => _serviceProvider ??= ServiceCollection.BuildServiceProvider();
private ServiceProvider _serviceProvider;
@@ -39,7 +38,6 @@ namespace BITKit.Entities
public void Dispose()
{
_cancellationTokenSource.Cancel();
_serviceProvider.Dispose();
}
}