Class ApplicationContext
Class that represents the common context of the entire application.
Inheritance
Implements
Inherited Members
Namespace: Fibula.Common
Assembly: Fibula.Common.dll
Syntax
public class ApplicationContext : IApplicationContext
Constructors
| Improve this Doc View SourceApplicationContext(IOptions<ApplicationContextOptions>, IRsaDecryptor, IItemTypeLoader, IMonsterTypeLoader, TelemetryClient, CancellationTokenSource, Func<IFibulaDbContext>)
Initializes a new instance of the ApplicationContext class.
Declaration
public ApplicationContext(IOptions<ApplicationContextOptions> options, IRsaDecryptor rsaDecryptor, IItemTypeLoader itemTypeLoader, IMonsterTypeLoader monsterTypeLoader, TelemetryClient telemetryClient, CancellationTokenSource cancellationTokenSource, Func<IFibulaDbContext> dbContextGenerationFunc)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Options.IOptions<ApplicationContextOptions> | options | A reference to the application configuration. |
IRsaDecryptor | rsaDecryptor | A reference to the RSA decryptor in use. |
IItemTypeLoader | itemTypeLoader | A reference to the item type loader in use. |
IMonsterTypeLoader | monsterTypeLoader | A reference to the monster type loader in use. |
Microsoft.ApplicationInsights.TelemetryClient | telemetryClient | A reference to the telemetry client. |
System.Threading.CancellationTokenSource | cancellationTokenSource | A reference to the master cancellation token source. |
System.Func<IFibulaDbContext> | dbContextGenerationFunc | A reference to a function to generate the database context. |
Properties
| Improve this Doc View SourceCancellationTokenSource
Gets the master cancellation token source.
Declaration
public CancellationTokenSource CancellationTokenSource { get; }
Property Value
Type | Description |
---|---|
System.Threading.CancellationTokenSource |
DefaultDatabaseContext
Gets the default database context to use.
Declaration
public IFibulaDbContext DefaultDatabaseContext { get; }
Property Value
Type | Description |
---|---|
IFibulaDbContext |
Options
Gets the configuration for the application.
Declaration
public ApplicationContextOptions Options { get; }
Property Value
Type | Description |
---|---|
ApplicationContextOptions |
RsaDecryptor
Gets the RSA decryptor to use.
Declaration
public IRsaDecryptor RsaDecryptor { get; }
Property Value
Type | Description |
---|---|
IRsaDecryptor |
TelemetryClient
Gets the Telemetry client in use.
Declaration
public TelemetryClient TelemetryClient { get; }
Property Value
Type | Description |
---|---|
Microsoft.ApplicationInsights.TelemetryClient |
Methods
| Improve this Doc View SourceCreateNewUnitOfWork()
Creates a new IUnitOfWork<TAccountsRepository, TCharactersRepository, TMonsterTypesRepository, TItemTypesRepository> for data access.
Declaration
public IUnitOfWork<IRepository<IAccountEntity>, IRepository<ICharacterEntity>, IReadOnlyRepository<IMonsterTypeEntity>, IReadOnlyRepository<IItemTypeEntity>> CreateNewUnitOfWork()
Returns
Type | Description |
---|---|
IUnitOfWork<IRepository<IAccountEntity>, IRepository<ICharacterEntity>, IReadOnlyRepository<IMonsterTypeEntity>, IReadOnlyRepository<IItemTypeEntity>> | The instance created. |