Skip to main content
.NET Framework 4.5.2+

Enumeration Properties in EF Core

The example below illustrates how to implement Enumeration Properties in an EF Core Code-First class.

public virtual TextOnlyEnum TextOnlyEnumProperty { get; set; }
public virtual TextAndImageEnum TextAndImageEnumProperty { get; set; }
// ...
public enum TextOnlyEnum { Minor, Moderate, Severe }
public enum TextAndImageEnum {

// Make sure that you use options.UseChangeTrackingProxies() in your DbContext settings.

To be able to use this enumeration type in design-time criteria editors, register it in the constructor of your ModuleBase descendant using the EnumProcessingHelper.RegisterEnum method as follows.

using DevExpress.Data.Filtering;
public sealed partial class MySolutionModule : ModuleBase {
    public MySolutionModule() {
See Also