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
IsPostLiked
Gets a value indicating whether the post was liked by the user.
public abstract bool IsPostLiked { get; }
Property Value
IsLoading
Gets a value indicating whether the post view model is currently loading.
public abstract bool IsLoading { get; }
Property Value
PostDto
The post's corresponding DTO
public abstract PostDto PostDto { get; }
Property Value
CommentCount
Gets the count of comments on the post.
public abstract int CommentCount { get; }
Property Value
LikeCount
Gets the count of likes on the post.
public abstract int LikeCount { get; }
Property Value
UserInformation
Gets the user information associated with the post.
public abstract UserInformationDto UserInformation { get; }
Property Value
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()