Table of Contents

Class NpgsqlDbContext

Namespace
FishMMO.Database.Npgsql
Assembly
FishMMO-DB.dll

Entity Framework Core DbContext for the FishMMO PostgreSQL database.

public class NpgsqlDbContext : DbContext, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IDisposable, IAsyncDisposable, IResettableService
Inheritance
NpgsqlDbContext
Implements
Inherited Members
Extension Methods

Remarks

This DbContext is created as a short-lived instance via INpgsqlDbContextFactory and is not pooled.

Constructors

NpgsqlDbContext(DbContextOptions, string)

Initializes a new instance of the NpgsqlDbContext class.

public NpgsqlDbContext(DbContextOptions options, string schema)

Parameters

options DbContextOptions

The DbContext options.

schema string

The database schema to use; defaults to DefaultSchema when empty.

Fields

DefaultSchema

Default schema name used when no schema is specified.

public const string DefaultSchema = "public"

Field Value

string

Properties

Accounts

Player accounts.

public DbSet<AccountEntity> Accounts { get; set; }

Property Value

DbSet<AccountEntity>

AuthTokens

Authentication tokens.

public DbSet<AuthTokenEntity> AuthTokens { get; set; }

Property Value

DbSet<AuthTokenEntity>

CharacterAbilities

Character abilities.

public DbSet<CharacterAbilityEntity> CharacterAbilities { get; set; }

Property Value

DbSet<CharacterAbilityEntity>

CharacterAchievements

Character achievements.

public DbSet<CharacterAchievementEntity> CharacterAchievements { get; set; }

Property Value

DbSet<CharacterAchievementEntity>

CharacterArchetypes

Character archetypes.

public DbSet<CharacterArchetypeEntity> CharacterArchetypes { get; set; }

Property Value

DbSet<CharacterArchetypeEntity>

CharacterAttributes

Character attributes.

public DbSet<CharacterAttributeEntity> CharacterAttributes { get; set; }

Property Value

DbSet<CharacterAttributeEntity>

CharacterBuffs

Character buffs.

public DbSet<CharacterBuffEntity> CharacterBuffs { get; set; }

Property Value

DbSet<CharacterBuffEntity>

CharacterDialogueChoices

Per-character dialogue choice bitmasks.

public DbSet<CharacterDialogueChoiceEntity> CharacterDialogueChoices { get; set; }

Property Value

DbSet<CharacterDialogueChoiceEntity>

CharacterFactions

Character faction standings.

public DbSet<CharacterFactionEntity> CharacterFactions { get; set; }

Property Value

DbSet<CharacterFactionEntity>

CharacterFriends

Character friends.

public DbSet<CharacterFriendEntity> CharacterFriends { get; set; }

Property Value

DbSet<CharacterFriendEntity>

CharacterGuilds

Character guild memberships.

public DbSet<CharacterGuildEntity> CharacterGuilds { get; set; }

Property Value

DbSet<CharacterGuildEntity>

CharacterHotkeys

Character hotkeys.

public DbSet<CharacterHotkeyEntity> CharacterHotkeys { get; set; }

Property Value

DbSet<CharacterHotkeyEntity>

CharacterItemCooldowns

Character item cooldowns.

public DbSet<CharacterItemCooldownEntity> CharacterItemCooldowns { get; set; }

Property Value

DbSet<CharacterItemCooldownEntity>

CharacterItems

Every item a character owns, in whichever container holds it.

public DbSet<CharacterItemEntity> CharacterItems { get; set; }

Property Value

DbSet<CharacterItemEntity>

Remarks

One table rather than the three it replaces. Three tables meant three identity sequences, so a row id could not identify an item — see CharacterItemEntity.

CharacterKnownAbilities

Character known abilities.

public DbSet<CharacterKnownAbilityEntity> CharacterKnownAbilities { get; set; }

Property Value

DbSet<CharacterKnownAbilityEntity>

CharacterMail

Character mail.

public DbSet<CharacterMailEntity> CharacterMail { get; set; }

Property Value

DbSet<CharacterMailEntity>

CharacterParties

Character party memberships.

public DbSet<CharacterPartyEntity> CharacterParties { get; set; }

Property Value

DbSet<CharacterPartyEntity>

CharacterPetAttributes

Character pet attributes.

public DbSet<CharacterPetAttributeEntity> CharacterPetAttributes { get; set; }

Property Value

DbSet<CharacterPetAttributeEntity>

CharacterPetBuffs

Character pet buffs.

public DbSet<CharacterPetBuffEntity> CharacterPetBuffs { get; set; }

Property Value

DbSet<CharacterPetBuffEntity>

CharacterPets

Character pets.

public DbSet<CharacterPetEntity> CharacterPets { get; set; }

Property Value

DbSet<CharacterPetEntity>

CharacterQuests

Character quests.

public DbSet<CharacterQuestEntity> CharacterQuests { get; set; }

Property Value

DbSet<CharacterQuestEntity>

CharacterSkills

Character skills.

public DbSet<CharacterSkillEntity> CharacterSkills { get; set; }

Property Value

DbSet<CharacterSkillEntity>

Characters

Player characters.

public DbSet<CharacterEntity> Characters { get; set; }

Property Value

DbSet<CharacterEntity>

Chat

Chat messages.

public DbSet<ChatEntity> Chat { get; set; }

Property Value

DbSet<ChatEntity>

ConnectionTokenKeys

Connection token verification keys (per-region HMAC keys).

public DbSet<ConnectionTokenKeyEntity> ConnectionTokenKeys { get; set; }

Property Value

DbSet<ConnectionTokenKeyEntity>

CurrencyLedger

Completed currency movements, append-only.

public DbSet<CurrencyLedgerEntity> CurrencyLedger { get; set; }

Property Value

DbSet<CurrencyLedgerEntity>

DeploymentSecrets

Deployment-global secrets (loaded at startup instead of env files).

public DbSet<DeploymentSecretEntity> DeploymentSecrets { get; set; }

Property Value

DbSet<DeploymentSecretEntity>

EmailQueue

Email queue.

public DbSet<EmailQueueEntity> EmailQueue { get; set; }

Property Value

DbSet<EmailQueueEntity>

GuildApplications

Pending guild recruitment applications.

public DbSet<GuildApplicationEntity> GuildApplications { get; set; }

Property Value

DbSet<GuildApplicationEntity>

GuildLogs

Guild activity log rows.

public DbSet<GuildLogEntity> GuildLogs { get; set; }

Property Value

DbSet<GuildLogEntity>

GuildRanks

Per-guild editable rank rows.

public DbSet<GuildRankEntity> GuildRanks { get; set; }

Property Value

DbSet<GuildRankEntity>

GuildUpdates

Guild update records.

public DbSet<GuildUpdateEntity> GuildUpdates { get; set; }

Property Value

DbSet<GuildUpdateEntity>

Guilds

Guilds.

public DbSet<GuildEntity> Guilds { get; set; }

Property Value

DbSet<GuildEntity>

KickRequests

Kick request records.

public DbSet<KickRequestEntity> KickRequests { get; set; }

Property Value

DbSet<KickRequestEntity>

LoginServerSigningKeys

Login server signing keys.

public DbSet<LoginServerSigningKeyEntity> LoginServerSigningKeys { get; set; }

Property Value

DbSet<LoginServerSigningKeyEntity>

LoginServers

Login server registry.

public DbSet<LoginServerEntity> LoginServers { get; set; }

Property Value

DbSet<LoginServerEntity>

Parties

Parties.

public DbSet<PartyEntity> Parties { get; set; }

Property Value

DbSet<PartyEntity>

PartyUpdates

Party update records.

public DbSet<PartyUpdateEntity> PartyUpdates { get; set; }

Property Value

DbSet<PartyUpdateEntity>

SceneServers

Scene server registry.

public DbSet<SceneServerEntity> SceneServers { get; set; }

Property Value

DbSet<SceneServerEntity>

Scenes

Scene instances.

public DbSet<SceneEntity> Scenes { get; set; }

Property Value

DbSet<SceneEntity>

Schema

Gets the database schema name for this context.

public string Schema { get; }

Property Value

string

SqlIntValues

Keyless entity set for mapping scalar integer results from raw SQL queries via FromSqlRaw.

public DbSet<SqlIntValue> SqlIntValues { get; set; }

Property Value

DbSet<SqlIntValue>

SqlLongValues

Keyless entity set for mapping scalar bigint results from raw SQL queries via FromSqlRaw.

public DbSet<SqlLongValue> SqlLongValues { get; set; }

Property Value

DbSet<SqlLongValue>

TwoFactorRecoveryCodes

Two-factor recovery codes.

public DbSet<TwoFactorRecoveryCodeEntity> TwoFactorRecoveryCodes { get; set; }

Property Value

DbSet<TwoFactorRecoveryCodeEntity>

WorldServers

World server registry.

public DbSet<WorldServerEntity> WorldServers { get; set; }

Property Value

DbSet<WorldServerEntity>

Methods

Dispose()

Releases the allocated resources for this context.

public override void Dispose()

DisposeAsync()

Releases the allocated resources for this context.

public override ValueTask DisposeAsync()

Returns

ValueTask

OnModelCreating(ModelBuilder)

Override this method to further configure the model that was discovered by convention from the entity types exposed in DbSet<TEntity> properties on your derived context. The resulting model may be cached and re-used for subsequent instances of your derived context.

protected override void OnModelCreating(ModelBuilder modelBuilder)

Parameters

modelBuilder ModelBuilder

The builder being used to construct the model for this context. Databases (and other extensions) typically define extension methods on this object that allow you to configure aspects of the model that are specific to a given database.

Remarks

If a model is explicitly set on the options for this context (via UseModel(IModel)) then this method will not be run.

Events

Disposed

Raised when this context is disposed. Used by NpgsqlDbContextFactory to track active context count.

public event EventHandler? Disposed

Event Type

EventHandler