---
title: Single or multiple list options
slug: cms-13/docs/single-or-multiple-list-options
createdAt: 2026-07-30T20:22:06.232Z
---

Set up single or multiple selections from a list of predefined values using the `SelectOne` and `SelectMany` attributes. These attributes are in the `EPiServer.Shell.ObjectEditing` namespace in the `EPiServer.UI` assembly. Define them on a property and reference a class implementing the `ISelectionFactory` interface:

```csharp
[ContentType]
public class SamplePage: PageData {
  [SelectOne(SelectionFactoryType = typeof (LanguageSelectionFactory))]
  public virtual string SingleLanguage {
    get;
    set;
  }

  [SelectMany(SelectionFactoryType = typeof (LanguageSelectionFactory))]
  public virtual string MultipleLanguage {
    get;
    set;
  }
}

public class LanguageSelectionFactory: ISelectionFactory {
  public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata) {
    return new ISelectItem[] {
      new SelectItem() {
        Text = "English", Value = "EN"
      }, new SelectItem() {
        Text = "Swahili", Value = "SW"
      }, new SelectItem() {
        Text = "French Polonesia", Value = "PF"
      }
    };
  }
}
```

## Create your attributes

Custom attributes let you follow the DRY principle and avoid repeating selection factory references across properties. If you use the same factory in several places, create a custom attribute. Inherit from the `EPiServer` attributes and override the `SelectionFactoryType` property:

```csharp
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class LanguageSelectionAttribute: SelectOneAttribute {
  public override Type SelectionFactoryType {
    get {
      return typeof (LanguageSelectionFactory);
    }
    set {
      base.SelectionFactoryType = value;
    }
  }
}
```
