C# Class EasyAuth.Storage.MemoryUserStore

Stores users in a list in memory.
Inheritance: IUserStore
Mostrar archivo Open project: adamkdean/EasyAuth Class Usage Examples

Public Methods

Method Description
AddUser ( string username, string password ) : void
DeleteUserById ( int id ) : void
GetAllUsers ( ) : List
GetUserById ( int id ) : User

Return a clone of the user data object This is so that they are forced to use the update method rather than just changing the object directly.

GetUserByUsername ( string username ) : User

Return a clone of the user data object This is so that they are forced to use the update method rather than just changing the object directly.

UpdateUserById ( int id, User newUser ) : void
UserExistsById ( int id ) : bool
UserExistsByUsername ( string username ) : bool

Protected Methods

Method Description
GetActualUserById ( int id ) : User

Return the actual object reference for the user We can use this to search by reference in the List<>

GetActualUserByUsername ( string username ) : User

Return the actual object reference for the user We can use this to search by reference in the List<>

Private Methods

Method Description
MemoryUserStore ( ) : System
Reset ( ) : void

Method Details

AddUser() public method

public AddUser ( string username, string password ) : void
username string
password string
return void

DeleteUserById() public method

public DeleteUserById ( int id ) : void
id int
return void

GetActualUserById() protected method

Return the actual object reference for the user We can use this to search by reference in the List<>
protected GetActualUserById ( int id ) : User
id int
return User

GetActualUserByUsername() protected method

Return the actual object reference for the user We can use this to search by reference in the List<>
protected GetActualUserByUsername ( string username ) : User
username string
return User

GetAllUsers() public method

public GetAllUsers ( ) : List
return List

GetUserById() public method

Return a clone of the user data object This is so that they are forced to use the update method rather than just changing the object directly.
public GetUserById ( int id ) : User
id int
return User

GetUserByUsername() public method

Return a clone of the user data object This is so that they are forced to use the update method rather than just changing the object directly.
public GetUserByUsername ( string username ) : User
username string
return User

UpdateUserById() public method

public UpdateUserById ( int id, User newUser ) : void
id int
newUser User
return void

UserExistsById() public method

public UserExistsById ( int id ) : bool
id int
return bool

UserExistsByUsername() public method

public UserExistsByUsername ( string username ) : bool
username string
return bool