Skip to content

IPostVm

Namespace: SlottyMedia.Backend.ViewModel.Partial.Post

The interface for post view model implementation.

public interface IPostVm

Properties

AuthPrincipalId

The user ID of the authentication principal

public abstract Nullable<Guid> AuthPrincipalId { get; }

Property Value

Nullable<Guid>

IsPostLiked

Gets a value indicating whether the post was liked by the user.

public abstract bool IsPostLiked { get; }

Property Value

Boolean

IsLoading

Gets a value indicating whether the post view model is currently loading.

public abstract bool IsLoading { get; }

Property Value

Boolean

PostDto

The post's corresponding DTO

public abstract PostDto PostDto { get; }

Property Value

PostDto

CommentCount

Gets the count of comments on the post.

public abstract int CommentCount { get; }

Property Value

Int32

LikeCount

Gets the count of likes on the post.

public abstract int LikeCount { get; }

Property Value

Int32

UserInformation

Gets the user information associated with the post.

public abstract UserInformationDto UserInformation { get; }

Property Value

UserInformationDto

Methods

Initialize(Guid, Action)

Initializes the post view model.

Task Initialize(Guid postId, Action onStateChanged)

Parameters

postId Guid
The ID of the post.

onStateChanged Action
An event that is triggered whenever the internal state changes. This is intended to re-render the component!

Returns

Task
A task that represents the asynchronous operation.

LikeThisPost()

Likes a post by a user.

Task LikeThisPost()

Returns

Task
A task that represents the asynchronous operation.

GoToPostPage()

Navigates to the post's dedicated page (/post/POST-ID)

void GoToPostPage()

GoToProfilePage()

Navigates to the post's owner's profile page (/profile/USER-ID)

void GoToProfilePage()