Documentation

Store

Read Method

Syntax:

public dynamic Read(int customPortletId, string key)

Parameters:

Parameter Type Description
customPortletId int The custom portlet id
key string The key of the stored item

Return value:

Type Description
dynamic A dynamic object containing the stored item

Examples:

@{
    var userCount = Store.Read(Model.CustomPortletId, "user-count-key");
}


Write Method

Syntax:

public void Write(int customPortletId, string key, string value)

Parameters:

Parameter Type Description
customPortletId int The custom portlet id
key string The key of the item to store
value string The value to store

Return value:

void

Examples:

@{
    var userCount = Api.User.GetAll().Where(user => user.LastName.StartsWith("Smi")).ToList().Count;
    Store.Write(Model.CustomPortletId, "user-count-key", userCount);
}