Skip to content

IForumService

Namespace: SlottyMedia.Backend.Services.Interfaces

The IForumService interface is responsible for handling forum related operations.

public interface IForumService

Methods

InsertForum(Guid, String)

Inserts a new forum into the database.

Task InsertForum(Guid creatorUserId, string forumTopic)

Parameters

creatorUserId Guid
The Creator UserID

forumTopic String
The Topic from the Forum

Returns

Task
Returns the inserted ForumDto object.

Exceptions

ForumIudException
Thrown when an error occurs during Insert, Update, or Delete operations.

ForumGeneralException
Thrown when a general error occurs.

DeleteForum(ForumDto)

Deletes a forum from the database based on the given forum ID.

Task DeleteForum(ForumDto forum)

Parameters

forum ForumDto
The forum to delete.

Returns

Task
Returns a Task representing the asynchronous operation.

Exceptions

ForumIudException
Thrown when an error occurs during Insert, Update, or Delete operations.

ForumGeneralException
Thrown when a general error occurs.

GetForumByName(String)

Retrieves a forum with the given name.

Task<ForumDto> GetForumByName(string forumName)

Parameters

forumName String
The forum's name.

Returns

Task<ForumDto>
The requested forum

Exceptions

ForumNotFoundException
Thrown when the forum is not found.

ForumGeneralException
Thrown when a general error occurs.

GetForumById(Guid)

Task<ForumDto> GetForumById(Guid forumId)

Parameters

forumId Guid

Returns

Task<ForumDto>

GetAllForums(PageRequest)

Retrieves all forums with pagination.

Task<IPage<ForumDto>> GetAllForums(PageRequest pageRequest)

Parameters

pageRequest PageRequest
The pagination request details.

Returns

Task<IPage<ForumDto>>
A paginated list of forums.

ExistsByName(String)

Task<bool> ExistsByName(string forumName)

Parameters

forumName String

Returns

Task<Boolean>

DetermineRecentSpaces()

Retrieves the 3 most recent forums based on the creation date.

Task<List<ForumDto>> DetermineRecentSpaces()

Returns

Task<List<ForumDto>>
A task that represents the asynchronous operation. The task result contains a list of the 3 most recent ForumDto objects.

Exceptions

ForumNotFoundException
Thrown when the forums are not found.

ForumGeneralException
Thrown when a general error occurs.

GetTopForums()

Retrieves the top forums.

Task<List<ForumDto>> GetTopForums()

Returns

Task<List<ForumDto>>
A task that represents the asynchronous operation. The task result contains a list of ForumDto objects representing the top forums.

Exceptions

ForumNotFoundException
Thrown when the forums are not found.

ForumGeneralException
Thrown when a general error occurs.