- Konstantenmodell mit UserLanguages String-Array erstellen. Hinzufügen einer benutzerdefinierten Methode zum Abrufen der Eigenschaft über Name. - imlement in appsettings und confgire in Program.cs
13 lines
414 B
C#
13 lines
414 B
C#
using System.Reflection;
|
|
|
|
namespace DigitalData.UserManager.API.Models
|
|
{
|
|
public class Constants
|
|
{
|
|
public IEnumerable<string> UserLanguages { get; init; } = Array.Empty<string>();
|
|
|
|
public object? this[string propertyName] => GetType()
|
|
.GetProperty(propertyName, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance)?
|
|
.GetValue(this, null);
|
|
}
|
|
} |