IDepartmentService
Responsible for managing Department objects.
Methods
CreateDepartment
Inserts a Department into the 'departments' table.
Parameters
| Name | Type | Description |
|---|---|---|
| department | Department | The department to insert. |
Returns
| Name | Type |
|---|---|
| Department | The created department object with change tracking. |
UpdateDepartment
Updates the given department.
Parameters
| Name | Type | Description |
|---|---|---|
| department | Department | The department to update. |
Returns
| Name | Type |
|---|---|
| Department | The updated department object with change tracking. |
DeleteDepartment
Deletes a Department from the 'departments' table.
Parameters
| Name | Type | Description |
|---|---|---|
| department | Department | The department to remove. |
CreateDivision
Inserts a Division into the 'divisions' table.
Parameters
| Name | Type | Description |
|---|---|---|
| division | Division | The division to insert. |
Returns
| Name | Type |
|---|---|
| Division | The created division object with change tracking. |
UpdateDivision
Updates the given division.
Parameters
| Name | Type | Description |
|---|---|---|
| division | Division | The division to update. |
Returns
| Name | Type |
|---|---|
| Division | The updated division object with change tracking. |
DeleteDivision
Deletes a Division from the 'departments' table.
Parameters
| Name | Type | Description |
|---|---|---|
| division | Division | The department to remove. |
GetDepartments
Selects and returns all departments.
Parameters
| Name | Type | Description |
|---|---|---|
| options | DepartmentQueryOptions | The options to use when querying the database. |
Returns
| Name | Type |
|---|---|
| IEnumerable<Department> | A list of departments. |
GetDepartmentById
Finds the first department with the given identifier.
Parameters
| Name | Type | Description |
|---|---|---|
| id | int | The identifier to search for. |
| options | DepartmentQueryOptions | The options to use when querying the database. |
Returns
| Name | Type |
|---|---|
| Department | The found department. |
AddPlayerToDepartment
Adds the given player to the given department.
Parameters
| Name | Type | Description |
|---|---|---|
| user | User | The user to update. |
| department | Department | The department to which the user will be added. |
AddPlayerToDepartment
Adds the given player to the given department.
Parameters
| Name | Type | Description |
|---|---|---|
| player | Player | The user to update. |
| department | Department | The department to which the user will be added. |
RemovePlayerFromDepartment
The given player will be removed from their department.
Parameters
| Name | Type | Description |
|---|---|---|
| user | User | The user to update. |
RemovePlayerFromDepartment
The given player will be removed from their department.
Parameters
| Name | Type | Description |
|---|---|---|
| player | Player | The user to update. |
RemovePlayerFromDepartment
The given player will be removed from their department.
Parameters
| Name | Type | Description |
|---|---|---|
| player | FPlayer | The user to update. |
GetPlayerDepartment
Gets the department of the given player.
Parameters
| Name | Type | Description |
|---|---|---|
| player | Player | The player. |
Returns
| Name | Type |
|---|---|
| Department | The department of the player. |
GetPlayerDepartment
Gets the department of the given player.
Parameters
| Name | Type | Description |
|---|---|---|
| player | FPlayer | The player. |
Returns
| Name | Type |
|---|---|
| Department | The department of the player. |
Events
DepartmentCreated
Fires when a department has been created.
Type: EventHandler<Department>
DepartmentUpdated
Fires when a department has been edited.
Type: EventHandler<Department>
DepartmentDeleted
Fires when a department has been deleted.
Type: EventHandler<Department>
DivisionCreated
Fires when a division has been created.
Type: EventHandler<Division>
DivisionUpdated
Fires when a division has been edited.
Type: EventHandler<Division>
DivisionDeleted
Fires when a division has been deleted.
Type: EventHandler<Division>
PlayerJoinedDepartment
Fires when a player joins a department or has been added to one with the API.
Type: EventHandler<PlayerDepartmentChangeEventArgs>
PlayerLeftDepartment
Fires when a player leaves a department or has been removed from one with the API.
Type: EventHandler<PlayerDepartmentChangeEventArgs>