Interface IUserSpecificPublicToggle
If an entity implements IUserSpecific, the class can implement this interface as well to automatically support private/public command toggles in the UI
This property should be marked as NotMapped so it does not form part of the class over web services
Namespace: LemonEdge.API.Entities.Bases
Assembly: API.dll
Syntax
public interface IUserSpecificPublicToggle
Remarks
The implementation of this interface for a class implementing IUserSpecific as well is as simple as follows:
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
public bool IsPublic
{
get => !UserID.HasValue;
set
{
var id = value ? (Guid?)null : LemonEdge.Client.Core.CommonUI.Connector.LoggedInUser?.ID;
if (!UserID.Equals(id))
{
OnPropertyChanging(nameof(IsPublic));
UserID = id;
OnPropertyChanged(nameof(IsPublic));
}
}
}
Properties
IsPublic
Indicates if this entity is visible to all users (public), or just the current user (private).
Directly maps to UserID property
Declaration
bool IsPublic { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |