C# Class WebApiSeed.Services.UserServices

User services
Inheritance: IUserServices
显示文件 Open project: MakingSense/webapi-seed

Public Methods

Method Description
DeleteUser ( int id ) : bool

Delete a user

FindUserById ( int id ) : User
FindUserByUserName ( string userName ) : User
GetAllUsers ( ) : IList
GetAllUsersDto ( ) : IEnumerable

Retrieve all users in the database

GetUserById ( int userId ) : UserDto

Retrieve a user based on its ID

GetUserByUsername ( string username ) : UserDto

Retrieve a user by username

LogoutUser ( int userId ) : UserDto

Logs out a user

SaveOrUpdateUser ( User user ) : void
UpdateUser ( UserDto userDto ) : UserServiceResult>.ServiceResult

Update user

UserServices ( IDbContext dbContext, IMapper mapperEngine, ISecurityHelper securityHelper ) : System.Collections.Generic

Constructor

Method Details

DeleteUser() public method

Delete a user
public DeleteUser ( int id ) : bool
id int
return bool

FindUserById() public method

public FindUserById ( int id ) : User
id int
return User

FindUserByUserName() public method

public FindUserByUserName ( string userName ) : User
userName string
return User

GetAllUsers() public method

public GetAllUsers ( ) : IList
return IList

GetAllUsersDto() public method

Retrieve all users in the database
public GetAllUsersDto ( ) : IEnumerable
return IEnumerable

GetUserById() public method

Retrieve a user based on its ID
public GetUserById ( int userId ) : UserDto
userId int
return UserDto

GetUserByUsername() public method

Retrieve a user by username
public GetUserByUsername ( string username ) : UserDto
username string Username
return UserDto

LogoutUser() public method

Logs out a user
public LogoutUser ( int userId ) : UserDto
userId int ID of the user
return UserDto

SaveOrUpdateUser() public method

public SaveOrUpdateUser ( User user ) : void
user User
return void

UpdateUser() public method

Update user
public UpdateUser ( UserDto userDto ) : UserServiceResult>.ServiceResult
userDto UserDto
return UserServiceResult>.ServiceResult

UserServices() public method

Constructor
public UserServices ( IDbContext dbContext, IMapper mapperEngine, ISecurityHelper securityHelper ) : System.Collections.Generic
dbContext IDbContext dbContext
mapperEngine IMapper Mapper engine
securityHelper ISecurityHelper Security helper
return System.Collections.Generic