mirror of
https://github.com/bitwarden/server
synced 2025-12-24 20:23:21 +00:00
* Add trial length parameter to trial initiation endpoint and email * Add feature flag that pegs trial length to 7 when disabled * Add optionality to Identity * Move feature service injection to identity accounts controller
19 lines
458 B
C#
19 lines
458 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Reflection;
|
|
|
|
namespace Bit.Core.Enums;
|
|
|
|
public static class EnumExtensions
|
|
{
|
|
public static string GetDisplayName(this Enum value)
|
|
{
|
|
var field = value.GetType().GetField(value.ToString());
|
|
if (field?.GetCustomAttribute<DisplayAttribute>() is { } attribute)
|
|
{
|
|
return attribute.Name ?? value.ToString();
|
|
}
|
|
|
|
return value.ToString();
|
|
}
|
|
}
|