public enum PhiAccessType
{
    View,
    List,
    Search,
    Create,
    Update
}

public static class PhiAccessTypeExtensions
{
    public static string ToDbString(this PhiAccessType t) => t switch
    {
        PhiAccessType.View   => "VIEW",
        PhiAccessType.List   => "LIST",
        PhiAccessType.Search => "SEARCH",
        PhiAccessType.Create => "CREATE",
        PhiAccessType.Update => "UPDATE",
        _ => throw new ArgumentOutOfRangeException(nameof(t))
    };

    public static PhiAccessType FromDbString(string v) => v switch
    {
        "VIEW"   => PhiAccessType.View,
        "LIST"   => PhiAccessType.List,
        "SEARCH" => PhiAccessType.Search,
        "CREATE" => PhiAccessType.Create,
        "UPDATE" => PhiAccessType.Update,
        _ => throw new ArgumentOutOfRangeException(nameof(v))
    };
}