Interface IUserService
Contains methods to manipulate user data
Namespace: Simplic.User
Assembly: Simplic.User.dll
Syntax
public interface IUserService
Methods
| Improve this Doc View SourceDelete(Int32)
Deletes a user
Declaration
bool Delete(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | User id to be deleted. |
Returns
Type | Description |
---|---|
System.Boolean | True if successfull |
GetAll()
Gets a list of all users
Declaration
IEnumerable<User> GetAll()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<User> | A list of User |
GetAllSorted(Boolean)
Gets a list of all users sorted by first name
Declaration
IEnumerable<User> GetAllSorted(bool activeOnly = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | activeOnly | If set to true, only active user will be selected |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<User> | A list of User |
GetApiUser(String, String)
Get user by apikey and username
Declaration
User GetApiUser(string apiKey, string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | apiKey | api key |
System.String | userName | User name |
Returns
Type | Description |
---|---|
User | A User |
GetByExternAccount(String)
Get the simplic user by an external account name
Declaration
User GetByExternAccount(string externAccountName)
Parameters
Type | Name | Description |
---|---|---|
System.String | externAccountName | External account name |
Returns
Type | Description |
---|---|
User | User id if found |
GetByGuid(Guid)
Gets a user by its Guid.
Declaration
User GetByGuid(Guid userGuid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | userGuid | guid of the user to search. |
Returns
Type | Description |
---|---|
User | A User |
GetById(Int32)
Gets a user given by its id
Declaration
User GetById(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | Id of the user to search |
Returns
Type | Description |
---|---|
User | A User |
GetByName(String)
Gets a user given by its name
Declaration
User GetByName(string userName)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | Name of the user to search |
Returns
Type | Description |
---|---|
User | A User |
Register(User)
Register new user
Declaration
bool Register(User user)
Parameters
Type | Name | Description |
---|---|---|
User | user | User instance |
Returns
Type | Description |
---|---|
System.Boolean | True if registration was successfull |
RemoveGroup(Int32, Int32)
Removes a group from a user
Declaration
bool RemoveGroup(int userId, int groupId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | User Id |
System.Int32 | groupId | Group Id |
Returns
Type | Description |
---|---|
System.Boolean | True if successfull |
RemoveTenant(Int32, Guid)
Removes a group from a user
Declaration
bool RemoveTenant(int userId, Guid tenantId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | User Id |
System.Guid | tenantId | Tenant Id |
Returns
Type | Description |
---|---|
System.Boolean | True if successfull |
Save(User)
Inserts or updates a user into the database
Declaration
bool Save(User user)
Parameters
Type | Name | Description |
---|---|---|
User | user | User to be saved. |
Returns
Type | Description |
---|---|
System.Boolean | True if successfull |
SetGroup(Int32, Int32)
Assigns a user to a group (updates on existing values)
Declaration
bool SetGroup(int userId, int groupId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | User Id |
System.Int32 | groupId | Group Id |
Returns
Type | Description |
---|---|
System.Boolean | True if successfull |
SetPassword(Int32, String)
Set new password for a given user
Declaration
bool SetPassword(int userId, string rawPassword)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | Current user id |
System.String | rawPassword | Raw password |
Returns
Type | Description |
---|---|
System.Boolean | True if setting the password was successfull |
SetTenant(Int32, Guid)
Assigns a user to a tenant (updates on existing values)
Declaration
bool SetTenant(int userId, Guid tenantId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | userId | User If |
System.Guid | tenantId | Tenant Id |
Returns
Type | Description |
---|---|
System.Boolean |