Esempio n. 1
0
        public async Task OnGet()
        {
            FriendLinks = await _friendLinkService.GetAllAsync();

            FriendLinkSettingsViewModel = new()
            {
                ShowFriendLinksSection = _blogConfig.FriendLinksSettings.ShowFriendLinksSection
            };
        }
    }
        public async Task <IViewComponentResult> InvokeAsync()
        {
            try
            {
                var links = await _friendLinkService.GetAllAsync();

                return(View(links ?? new List <Link>()));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Error Reading FriendLink.");
                return(Content(e.Message));
            }
        }
Esempio n. 3
0
        public async Task <IActionResult> FriendLink()
        {
            var links = await _friendLinkService.GetAllAsync();

            var vm = new FriendLinkSettingsViewModelWrap
            {
                FriendLinkSettingsViewModel = new()
                {
                    ShowFriendLinksSection = _blogConfig.FriendLinksSettings.ShowFriendLinksSection
                },
                FriendLinks = links
            };

            return(View(vm));
        }
        public async Task <IViewComponentResult> InvokeAsync()
        {
            try
            {
                var links = await _friendLinkService.GetAllAsync();

                return(View(links ?? new List <FriendLink.Link>()));
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Error Reading FriendLink.");

                ViewBag.ComponentErrorMessage = e.Message;
                return(View("~/Views/Shared/ComponentError.cshtml"));
            }
        }
Esempio n. 5
0
 public async Task OnGet()
 {
     FriendLinks = await _friendLinkService.GetAllAsync();
 }