コード例 #1
0
        public EmailAuthorPopOutViewModel(
            ITextTranslator textTranslator,
            IRenderingItemContext articleRenderingContext,
            IAuthenticatedUserContext userContext,
            IAuthorIndexClient authorIndexClient,
            IHttpContextProvider httpContext)
        {
            TextTranslator          = textTranslator;
            ArticleRenderingContext = articleRenderingContext;
            UserContext             = userContext;
            AuthorIndexClient       = authorIndexClient;
            HttpContext             = httpContext;

            Author = AuthorIndexClient.GetAuthorByUrlName(HttpContext.Current.Request.Url.Segments.Last());
        }
コード例 #2
0
        public AuthorShareViewModel(
            IAuthorIndexClient authorIndexClient,
            IHttpContextProvider httpContext,
            ITextTranslator textTranslator)
        {
            AuthorIndexClient = authorIndexClient;
            HttpContext       = httpContext;
            TextTranslator    = textTranslator;

            PageTitle = string.Empty;
            var Author = AuthorIndexClient.GetAuthorByUrlName(HttpContext.Current.Request.Url.Segments.Last());

            if (Author == null)
            {
                HandleNullAuthor();
            }
            else
            {
                PageTitle = $"{Author.First_Name} {Author.Last_Name}";
            }
        }