Index.cshtml.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. using System.Globalization;
  3. using System.Threading.Tasks;
  4. using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
  5. using Volo.Abp.Localization;
  6. using Volo.Abp.OpenIddict.Applications;
  7. namespace AuthServer.Pages;
  8. public class IndexModel : AbpPageModel
  9. {
  10. public List<OpenIddictApplication> Applications { get; protected set; }
  11. public IReadOnlyList<LanguageInfo> Languages { get; protected set; }
  12. public string CurrentLanguage { get; protected set; }
  13. protected IOpenIddictApplicationRepository OpenIdApplicationRepository { get; }
  14. protected ILanguageProvider LanguageProvider { get; }
  15. public IndexModel(IOpenIddictApplicationRepository openIdApplicationmRepository, ILanguageProvider languageProvider)
  16. {
  17. OpenIdApplicationRepository = openIdApplicationmRepository;
  18. LanguageProvider = languageProvider;
  19. }
  20. public async Task OnGetAsync()
  21. {
  22. Applications = await OpenIdApplicationRepository.GetListAsync();
  23. Languages = await LanguageProvider.GetLanguagesAsync();
  24. CurrentLanguage = CultureInfo.CurrentCulture.DisplayName;
  25. }
  26. }