public AccountCategoryModel(AccountCategory category) { Category = category; Name = $"{category}"; Value = (short)category; var type = category.GetType(); var attribute = type.GetField(Name) .GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute; Summary = attribute.Description; }