C# Class DapperIdentity.Data.Repositories.UserRepository

Inheritance: BaseRepository, IUserRepository
Show file Open project: rantowork/MVC5-Dapper-Identity

Public Methods

Method Description
AddLoginAsync ( User user, Microsoft.AspNet.Identity.UserLoginInfo login ) : System.Threading.Tasks.Task

INSERT operation for adding an external login such as Google for a new or existing account.

CreateAsync ( User user ) : System.Threading.Tasks.Task

INSERT operation for a new user.

DeleteAsync ( User user ) : System.Threading.Tasks.Task

DELETE operation for a user. This is not currently used, but required by .NET Identity.

Dispose ( ) : void
FindAsync ( Microsoft.AspNet.Identity.UserLoginInfo login ) : Task

SELECT operation for getting the user object associated with a specific external login

FindByIdAsync ( string userId ) : Task

SELECT operation for finding a user by the Id value. Our Id is currently a GUID but this can be another data type as well.

FindByNameAsync ( string userName ) : Task

SELECT operation for finding a user by the username.

GetLoginsAsync ( User user ) : Task>

SELECT operation for getting external logins for a user account.

GetPasswordHashAsync ( User user ) : Task

Method for getting teh password hash for the user account.

GetSecurityStampAsync ( User user ) : Task

Method for getting the security stamp for the user account.

HasPasswordAsync ( User user ) : Task

Method for checking if an account has a password hash.

RemoveLoginAsync ( User user, Microsoft.AspNet.Identity.UserLoginInfo login ) : System.Threading.Tasks.Task

DELETE operation for removing an external login from an existing user account.

SetPasswordHashAsync ( User user, string passwordHash ) : System.Threading.Tasks.Task

Method for setting the password hash for the user account. This hash is used to encode the users password.

SetSecurityStampAsync ( User user, string stamp ) : System.Threading.Tasks.Task

Method for setting the security stamp for the user account.

UpdateAsync ( User user ) : System.Threading.Tasks.Task

UPDATE operation for updating a user.

UserRepository ( IConnectionFactory connectionFactory ) : System

User Repository constructor passing injected connection factory to the Base Repository

Method Details

AddLoginAsync() public method

INSERT operation for adding an external login such as Google for a new or existing account.
public AddLoginAsync ( User user, Microsoft.AspNet.Identity.UserLoginInfo login ) : System.Threading.Tasks.Task
user DapperIdentity.Core.Entities.User The User object that will be associated with the external login information.
login Microsoft.AspNet.Identity.UserLoginInfo The user login information. This object is constructed during the callback from the external authority.
return System.Threading.Tasks.Task

CreateAsync() public method

INSERT operation for a new user.
public CreateAsync ( User user ) : System.Threading.Tasks.Task
user DapperIdentity.Core.Entities.User The User object must be passed in. We create this during the Register Action.
return System.Threading.Tasks.Task

DeleteAsync() public method

DELETE operation for a user. This is not currently used, but required by .NET Identity.
public DeleteAsync ( User user ) : System.Threading.Tasks.Task
user DapperIdentity.Core.Entities.User The User object
return System.Threading.Tasks.Task

Dispose() public method

public Dispose ( ) : void
return void

FindAsync() public method

SELECT operation for getting the user object associated with a specific external login
public FindAsync ( Microsoft.AspNet.Identity.UserLoginInfo login ) : Task
login Microsoft.AspNet.Identity.UserLoginInfo The external account
return Task

FindByIdAsync() public method

SELECT operation for finding a user by the Id value. Our Id is currently a GUID but this can be another data type as well.
public FindByIdAsync ( string userId ) : Task
userId string The Id of the user object.
return Task

FindByNameAsync() public method

SELECT operation for finding a user by the username.
public FindByNameAsync ( string userName ) : Task
userName string The username of the user object.
return Task

GetLoginsAsync() public method

SELECT operation for getting external logins for a user account.
public GetLoginsAsync ( User user ) : Task>
user DapperIdentity.Core.Entities.User The user account to get external login information for.
return Task>

GetPasswordHashAsync() public method

Method for getting teh password hash for the user account.
public GetPasswordHashAsync ( User user ) : Task
user DapperIdentity.Core.Entities.User The user to get the password hash for.
return Task

GetSecurityStampAsync() public method

Method for getting the security stamp for the user account.
public GetSecurityStampAsync ( User user ) : Task
user DapperIdentity.Core.Entities.User The user to get the security stamp for.
return Task

HasPasswordAsync() public method

Method for checking if an account has a password hash.
public HasPasswordAsync ( User user ) : Task
user DapperIdentity.Core.Entities.User The user to check for an existing password hash.
return Task

RemoveLoginAsync() public method

DELETE operation for removing an external login from an existing user account.
public RemoveLoginAsync ( User user, Microsoft.AspNet.Identity.UserLoginInfo login ) : System.Threading.Tasks.Task
user DapperIdentity.Core.Entities.User The user object that the external login will be removed from.
login Microsoft.AspNet.Identity.UserLoginInfo The external login that will be removed from the user account.
return System.Threading.Tasks.Task

SetPasswordHashAsync() public method

Method for setting the password hash for the user account. This hash is used to encode the users password.
public SetPasswordHashAsync ( User user, string passwordHash ) : System.Threading.Tasks.Task
user DapperIdentity.Core.Entities.User The user to has the password for.
passwordHash string The password has to use.
return System.Threading.Tasks.Task

SetSecurityStampAsync() public method

Method for setting the security stamp for the user account.
public SetSecurityStampAsync ( User user, string stamp ) : System.Threading.Tasks.Task
user DapperIdentity.Core.Entities.User The user to set the security stamp for.
stamp string The stamp to set.
return System.Threading.Tasks.Task

UpdateAsync() public method

UPDATE operation for updating a user.
public UpdateAsync ( User user ) : System.Threading.Tasks.Task
user DapperIdentity.Core.Entities.User The user that will be updated. The updated values must be passed in to this method.
return System.Threading.Tasks.Task

UserRepository() public method

User Repository constructor passing injected connection factory to the Base Repository
public UserRepository ( IConnectionFactory connectionFactory ) : System
connectionFactory IConnectionFactory The injected connection factory. It is injected with the constructor argument that is the connection string.
return System