Class UserContext
Namespace: Identity.Infrastructure.Persistence
Assembly: Identity.Infrastructure.dll
Database context class for managing users.
Inheritance
Implements
IInfrastructure<IServiceProvider\>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IDisposable, IAsyncDisposable
Inherited Members
DbContext.Set<TEntity\>\(\), DbContext.Set<TEntity\>\(string\), DbContext.SaveChanges\(\), DbContext.SaveChanges\(bool\), DbContext.SaveChangesAsync\(CancellationToken\), DbContext.SaveChangesAsync\(bool, CancellationToken\), DbContext.Dispose\(\), DbContext.DisposeAsync\(\), DbContext.Entry<TEntity\>\(TEntity\), DbContext.Entry\(object\), DbContext.Add<TEntity\>\(TEntity\), DbContext.AddAsync<TEntity\>\(TEntity, CancellationToken\), DbContext.Attach<TEntity\>\(TEntity\), DbContext.Update<TEntity\>\(TEntity\), DbContext.Remove<TEntity\>\(TEntity\), DbContext.Add\(object\), DbContext.AddAsync\(object, CancellationToken\), DbContext.Attach\(object\), DbContext.Update\(object\), DbContext.Remove\(object\), DbContext.AddRange\(params object\[\]\), DbContext.AddRangeAsync\(params object\[\]\), DbContext.AttachRange\(params object\[\]\), DbContext.UpdateRange\(params object\[\]\), DbContext.RemoveRange\(params object\[\]\), DbContext.AddRange\(IEnumerable<object\>\), DbContext.AddRangeAsync\(IEnumerable<object\>, CancellationToken\), DbContext.AttachRange\(IEnumerable<object\>\), DbContext.UpdateRange\(IEnumerable<object\>\), DbContext.RemoveRange\(IEnumerable<object\>\), DbContext.Find\(Type, params object?\[\]?\), DbContext.FindAsync\(Type, params object?\[\]?\), DbContext.FindAsync\(Type, object?\[\]?, CancellationToken\), DbContext.Find<TEntity\>\(params object?\[\]?\), DbContext.FindAsync<TEntity\>\(params object?\[\]?\), DbContext.FindAsync<TEntity\>\(object?\[\]?, CancellationToken\), DbContext.FromExpression<TResult\>\(Expression<Func<IQueryable<TResult\>\>\>\), DbContext.Database, DbContext.ChangeTracker, DbContext.Model, DbContext.ContextId, DbContext.SavingChanges, DbContext.SavedChanges, DbContext.SaveChangesFailed, object.Equals\(object?\), object.Equals\(object?, object?\), object.GetHashCode\(\), object.GetType\(\), object.ReferenceEquals\(object?, object?\), object.ToString\(\)
Constructors
UserContext\(DbContextOptions<UserContext\>, IOptions<ConnectionStrings\>\)
Class constructor.
Parameters
options DbContextOptions < UserContext \>
Database context options.
connectionStringsOptions IOptions < ConnectionStrings \>
Connection strings options.
Properties
Roles
Data set for user roles.
Property Value
DbSet <Role\>
Users
Data set for users.
Property Value
DbSet <User\>
Methods
OnConfiguring\(DbContextOptionsBuilder\)
Method for configuring database context options.
Parameters
optionsBuilder DbContextOptionsBuilder
Database context options builder.
OnModelCreating\(ModelBuilder\)
Method that execute instructions on model creation, used to auto-populate roles.
Parameters
modelBuilder ModelBuilder