Class NpgsqlDbContext
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
optionsDbContextOptionsThe DbContext options.
schemastringThe 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
Properties
Accounts
Player accounts.
public DbSet<AccountEntity> Accounts { get; set; }
Property Value
AuthTokens
Authentication tokens.
public DbSet<AuthTokenEntity> AuthTokens { get; set; }
Property Value
CharacterAbilities
Character abilities.
public DbSet<CharacterAbilityEntity> CharacterAbilities { get; set; }
Property Value
CharacterAchievements
Character achievements.
public DbSet<CharacterAchievementEntity> CharacterAchievements { get; set; }
Property Value
CharacterArchetypes
Character archetypes.
public DbSet<CharacterArchetypeEntity> CharacterArchetypes { get; set; }
Property Value
CharacterAttributes
Character attributes.
public DbSet<CharacterAttributeEntity> CharacterAttributes { get; set; }
Property Value
CharacterBuffs
Character buffs.
public DbSet<CharacterBuffEntity> CharacterBuffs { get; set; }
Property Value
CharacterDialogueChoices
Per-character dialogue choice bitmasks.
public DbSet<CharacterDialogueChoiceEntity> CharacterDialogueChoices { get; set; }
Property Value
CharacterFactions
Character faction standings.
public DbSet<CharacterFactionEntity> CharacterFactions { get; set; }
Property Value
CharacterFriends
Character friends.
public DbSet<CharacterFriendEntity> CharacterFriends { get; set; }
Property Value
CharacterGuilds
Character guild memberships.
public DbSet<CharacterGuildEntity> CharacterGuilds { get; set; }
Property Value
CharacterHotkeys
Character hotkeys.
public DbSet<CharacterHotkeyEntity> CharacterHotkeys { get; set; }
Property Value
CharacterItemCooldowns
Character item cooldowns.
public DbSet<CharacterItemCooldownEntity> CharacterItemCooldowns { get; set; }
Property Value
CharacterItems
Every item a character owns, in whichever container holds it.
public DbSet<CharacterItemEntity> CharacterItems { get; set; }
Property Value
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
CharacterMail
Character mail.
public DbSet<CharacterMailEntity> CharacterMail { get; set; }
Property Value
CharacterParties
Character party memberships.
public DbSet<CharacterPartyEntity> CharacterParties { get; set; }
Property Value
CharacterPetAttributes
Character pet attributes.
public DbSet<CharacterPetAttributeEntity> CharacterPetAttributes { get; set; }
Property Value
CharacterPetBuffs
Character pet buffs.
public DbSet<CharacterPetBuffEntity> CharacterPetBuffs { get; set; }
Property Value
CharacterPets
Character pets.
public DbSet<CharacterPetEntity> CharacterPets { get; set; }
Property Value
CharacterQuests
Character quests.
public DbSet<CharacterQuestEntity> CharacterQuests { get; set; }
Property Value
CharacterSkills
Character skills.
public DbSet<CharacterSkillEntity> CharacterSkills { get; set; }
Property Value
Characters
Player characters.
public DbSet<CharacterEntity> Characters { get; set; }
Property Value
Chat
Chat messages.
public DbSet<ChatEntity> Chat { get; set; }
Property Value
ConnectionTokenKeys
Connection token verification keys (per-region HMAC keys).
public DbSet<ConnectionTokenKeyEntity> ConnectionTokenKeys { get; set; }
Property Value
CurrencyLedger
Completed currency movements, append-only.
public DbSet<CurrencyLedgerEntity> CurrencyLedger { get; set; }
Property Value
DeploymentSecrets
Deployment-global secrets (loaded at startup instead of env files).
public DbSet<DeploymentSecretEntity> DeploymentSecrets { get; set; }
Property Value
EmailQueue
Email queue.
public DbSet<EmailQueueEntity> EmailQueue { get; set; }
Property Value
GuildApplications
Pending guild recruitment applications.
public DbSet<GuildApplicationEntity> GuildApplications { get; set; }
Property Value
GuildLogs
Guild activity log rows.
public DbSet<GuildLogEntity> GuildLogs { get; set; }
Property Value
GuildRanks
Per-guild editable rank rows.
public DbSet<GuildRankEntity> GuildRanks { get; set; }
Property Value
GuildUpdates
Guild update records.
public DbSet<GuildUpdateEntity> GuildUpdates { get; set; }
Property Value
Guilds
Guilds.
public DbSet<GuildEntity> Guilds { get; set; }
Property Value
KickRequests
Kick request records.
public DbSet<KickRequestEntity> KickRequests { get; set; }
Property Value
LoginServerSigningKeys
Login server signing keys.
public DbSet<LoginServerSigningKeyEntity> LoginServerSigningKeys { get; set; }
Property Value
LoginServers
Login server registry.
public DbSet<LoginServerEntity> LoginServers { get; set; }
Property Value
Parties
Parties.
public DbSet<PartyEntity> Parties { get; set; }
Property Value
PartyUpdates
Party update records.
public DbSet<PartyUpdateEntity> PartyUpdates { get; set; }
Property Value
SceneServers
Scene server registry.
public DbSet<SceneServerEntity> SceneServers { get; set; }
Property Value
Scenes
Scene instances.
public DbSet<SceneEntity> Scenes { get; set; }
Property Value
Schema
Gets the database schema name for this context.
public string Schema { get; }
Property Value
SqlIntValues
Keyless entity set for mapping scalar integer results from raw SQL queries via FromSqlRaw.
public DbSet<SqlIntValue> SqlIntValues { get; set; }
Property Value
SqlLongValues
Keyless entity set for mapping scalar bigint results from raw SQL queries via FromSqlRaw.
public DbSet<SqlLongValue> SqlLongValues { get; set; }
Property Value
TwoFactorRecoveryCodes
Two-factor recovery codes.
public DbSet<TwoFactorRecoveryCodeEntity> TwoFactorRecoveryCodes { get; set; }
Property Value
WorldServers
World server registry.
public DbSet<WorldServerEntity> WorldServers { get; set; }
Property Value
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
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
modelBuilderModelBuilderThe 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