JenkinsFile

This commit is contained in:
Marco Santos
2024-09-27 18:40:30 +01:00
parent f88eb65384
commit ba1130b65a
9 changed files with 94 additions and 28 deletions

18
GeradoresService/Utils.cs Normal file
View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
public static class EnumHelper
{
public static List<(T Value, string Description)> GetEnumValuesAndDescriptions<T>() where T : Enum
{
return typeof(T).GetFields()
.Select(field => (
Value: (T)field.GetValue(null),
Description: field.GetCustomAttribute<DescriptionAttribute>()?.Description ?? field.Name
))
.ToList();
}
}