Skip to content

IPostRepository

Namespace: SlottyMedia.Database.Repository.PostRepo

Interface for the Post Repository.

public interface IPostRepository : SlottyMedia.Database.Repository.IDatabaseRepository`1[[SlottyMedia.Database.Daos.PostsDao, SlottyMedia.Database, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]

Implements IDatabaseRepository<PostsDao>

Methods

GetForumCountByUserId(Guid)

Gets the count of forums by a specific user.

Task<int> GetForumCountByUserId(Guid userId)

Parameters

userId Guid
The unique identifier of the user.

Returns

Task<Int32>
A task that represents the asynchronous operation. The task result contains the count of forums.

GetAllElements(PageRequest)

Gets all elements with pagination.

Task<IPage<PostsDao>> GetAllElements(PageRequest pageRequest)

Parameters

pageRequest PageRequest
The page request

Returns

Task<IPage<PostsDao>>
A task that represents the asynchronous operation. The task result contains a list of elements.

Exceptions

DatabaseMissingItemException
Thrown when the entity is not found in the database.

GeneralDatabaseException
Thrown when an unexpected error occurs.

CountAllPosts()

Counts all existing posts.

Task<int> CountAllPosts()

Returns

Task<Int32>
The total number of existing posts

GetPostsByUserId(Guid, PageRequest)

Gets posts by a specific user with pagination.

Task<IPage<PostsDao>> GetPostsByUserId(Guid userId, PageRequest pageRequest)

Parameters

userId Guid
The unique identifier of the user.

pageRequest PageRequest
The page request

Returns

Task<IPage<PostsDao>>
A task that represents the asynchronous operation. The task result contains a list of posts.

Exceptions

DatabaseMissingItemException
Thrown when the entity is not found in the database.

GeneralDatabaseException
Thrown when an unexpected error occurs.

GetPostsByUserIdByForumId(Guid, Guid, PageRequest)

Gets posts by a specific user and forum with pagination.

Task<IPage<PostsDao>> GetPostsByUserIdByForumId(Guid userId, Guid forumId, PageRequest pageRequest)

Parameters

userId Guid
The unique identifier of the user.

forumId Guid
The unique identifier of the forum.

pageRequest PageRequest
The page request

Returns

Task<IPage<PostsDao>>
A task that represents the asynchronous operation. The task result contains a list of posts.

Exceptions

DatabaseMissingItemException
Thrown when the entity is not found in the database.

GeneralDatabaseException
Thrown when an unexpected error occurs.

GetPostsByForumId(Guid, PageRequest)

Gets posts by a specific forum with pagination.

Task<IPage<PostsDao>> GetPostsByForumId(Guid forumId, PageRequest pageRequest)

Parameters

forumId Guid
The unique identifier of the forum.

pageRequest PageRequest
The page request

Returns

Task<IPage<PostsDao>>
A task that represents the asynchronous operation. The task result contains a list of posts.

Exceptions

DatabaseMissingItemException
Thrown when the entity is not found in the database.

GeneralDatabaseException
Thrown when an unexpected error occurs.