Sana Assistant (online)
Table of Contents

EntityTemplateFieldEditorSettings reference

This article provides reference material about EntityTemplateFieldEditorSettings class.

This is empty class which should be used as a base type for template field editor settings class. The class properties will be managed in admin per entity field and then can be used on client side for field value management.

The list of supported .NET types for class properties:

  • string
  • int
  • long
  • uint
  • ulong
  • DateOnly
  • Guid
  • decimal
  • bool
  • DateTime
  • enum

Properties of other types are not supported and will be managed in admin as string. It is possible to use properties of custom types and initialize values by editor extensions, and then use them for field value management on client side. Such properties should be marked with [ScaffoldColumn(false)] so they will not be managed in admin.

[Display] attribute can be used on properties to specify property title, description and sort order for admin management. Resource text keys can be used for title and description, so the texts from admin resources will be shown.

Example

public class DeliveryDateTemplateFieldEditorSettings : EntityTemplateFieldEditorSettings
{
    [Display(Name = "AvailabilityInDaysTitle", Order = 10, Description = "AvailabilityInDaysDescription")]
    public uint AvailabilityInDays { get; set; }

    [Display(Name = "DeliveryDateDisplayLongFormat", Order = 20, Description = "DeliveryDateDisplayLongFormatDescription")]
    public bool LongFormat { get; set; }

    [ScaffoldColumn(false)]
    public List<DateOnly>? NotAvailableDates { get; set; }
}

See also