Exemplo n.º 1
0
        private static IEnumerable <LookupValue> GetLookupValues <T>(this Dictionary <int, string> dictionary)
        {
            var invoiceTypes = EnumUtils.EnumDictionary <T>();

            return(dictionary.Select(kvp =>
                                     new LookupValue {
                Id = new Guid(),
                LookupType = nameof(T),
                LookupKey = kvp.Key,
                LookupText = kvp.Value,
            }));
        }
Exemplo n.º 2
0
        private static IEnumerable <LookupValue> AddEnumToSeed <T>(this List <LookupValue> data)
        {
            var dictionary = EnumUtils.EnumDictionary <T>();

            data.AddRange(
                dictionary.Select(kvp =>
                                  new LookupValue
            {
                Id         = Guid.NewGuid(),
                LookupType = typeof(T).Name,
                LookupKey  = kvp.Key,
                LookupText = kvp.Value,
            }));
            return(data);
        }