Skip to content

IPostPageVm

Namespace: SlottyMedia.Backend.ViewModel.Pages.Post

This ViewModel represents the state of the PostPage.

public interface IPostPageVm

Properties

IsLoadingPage

Indicates whether the post is being fetched (i.e. the whole page is loading)

public abstract bool IsLoadingPage { get; }

Property Value

Boolean

IsLoadingComments

Indicates whether additional comments are being fetched

public abstract bool IsLoadingComments { get; }

Property Value

Boolean

Post

The post that will be showcased. If null, then the post is either being fetched or it does not exist.

public abstract PostDto Post { get; }

Property Value

PostDto

Comments

The comments that belong to the post

public abstract IPage<CommentDto> Comments { get; }

Property Value

IPage<CommentDto>

AuthPrincipalId

The ID of the currently logged in user.

public abstract Nullable<Guid> AuthPrincipalId { get; }

Property Value

Nullable<Guid>

Methods

Initialize(Guid)

Attempts to load the given post. If no such post exists, then IPostPageVm.Post will be null. Otherwise, it will be a PostDto that corresponds to the requested post.

Task Initialize(Guid postId)

Parameters

postId Guid
The ID of the post to showcase

Returns

Task

LoadCommentsPage(Int32)

Attempts to load more comments than were already showcased. Does nothing if no further comments exist.

Task LoadCommentsPage(int pageNumber)

Parameters

pageNumber Int32

Returns

Task