Table of Contents

Class UserExtensions

Namespace
Dynamicweb.Frontend
Assembly
Dynamicweb.dll

Extension helpers for mapping User entities to frontend view models.

public static class UserExtensions
Inheritance
UserExtensions
Inherited Members

Remarks

This static class contains extension methods intended for use in frontend rendering scenarios. Methods are side-effect free and delegate model construction to ContentViewModelFactory to ensure consistent mapping logic across the application.

Methods

GetUserViewModel(User)

Creates a UserViewModel for the specified User. Validates the input and delegates construction to ContentViewModelFactory.

public static UserViewModel GetUserViewModel(this User user)

Parameters

user User

The User instance to map into a UserViewModel.

Returns

UserViewModel

A UserViewModel representing the provided User.

Examples

Example usage in a rendering component:

var userViewModel = currentUser.GetUserViewModel();
// Pass the view model to the view for rendering

Exceptions

ArgumentNullException

Thrown when user is null.

To top