TokenRepo¶
Namespace: Database.Repository.TokenRepo
Repository implementation for managing TokenInfo entities.
Inheritance Object → TokenRepo
Implements ITokenRepo
Constructors¶
TokenRepo(ApplicationDbContext)¶
Initializes a new instance of the TokenRepo class.
Parameters¶
context
ApplicationDbContext
The database context.
Exceptions¶
ArgumentNullException
Thrown when context is null.
Methods¶
AddTokenInfoAsync(TokenInfo)¶
Adds a new token info.
Parameters¶
tokenInfo
TokenInfo
The token info to add.
Returns¶
A task representing the asynchronous operation.
GetTokenInfoByRefreshTokenAsync(String)¶
Gets a token info by refresh token.
Parameters¶
refreshToken
String
The refresh token to search for.
Returns¶
The token info if found; otherwise, null.
GetTokenInfoByUsernameAsync(String)¶
Gets a token info by username.
Parameters¶
username
String
The username to search for.
Returns¶
The token info if found; otherwise, null.
GetTokenInfoByUsernameSync(String)¶
Gets the first token info for a user by username.
Parameters¶
username
String
The username to search for.
Returns¶
The first token info if found; otherwise, null.
SaveChangesAsync()¶
Saves changes to the database.
Returns¶
A task representing the asynchronous operation.
UpdateTokenInfoAsync(TokenInfo)¶
Updates an existing token info.
Parameters¶
tokenInfo
TokenInfo
The token info to update.
Returns¶
A task representing the asynchronous operation.