Verifying.razor.cs 967 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.Reflection;
  7. using Microsoft.AspNetCore.Components;
  8. using HyperCube.Models;
  9. namespace HyperCube.Pages
  10. {
  11. public partial class Verifying : ComponentBase
  12. {
  13. [Inject]
  14. public AppData AppData { get; set; }
  15. private Dictionary<int, ArticleModel> articles = new();
  16. private int counter;
  17. protected override async Task OnInitializedAsync()
  18. {
  19. articles = await AppData.GetArticles();
  20. counter = 1;
  21. }
  22. private static string GetDisplayName(Enum enumValue)
  23. {
  24. return enumValue.GetType()
  25. .GetMember(enumValue.ToString())
  26. .First()
  27. .GetCustomAttribute<DisplayAttribute>()
  28. .GetName();
  29. }
  30. }
  31. }