Exemple #1
0
        public async Task OnGet()
        {
            var resources = await _context.GetResourcesAsync();

            Resources = new List <SelectListItem>();
            foreach (var resource in resources)
            {
                if (resource.Metadata.ContainsKey("Title"))
                {
                    Resources.Add(new SelectListItem(resource.Metadata["Title"], resource.Id.ToString()));
                }
                else
                {
                    Resources.Add(new SelectListItem(resource.Location, resource.Id.ToString()));
                }
            }

            var users = await _context.GetUsersAsync();

            Users = users.Select(u => new SelectListItem(u.Name, u.Id.ToString())).ToList();
        }
Exemple #2
0
 public async Task OnGetAsync()
 {
     Resources = await _context.GetResourcesAsync();
 }