public FavoriteController(ApplicationContext contextApp, ArticleContext contextArt, IGetFavorite getFavorite, IGetArticle getArticle)
 {
     db           = contextArt;
     dbUsers      = contextApp;
     _getFavorite = getFavorite;
     _getArticle  = getArticle;
 }
Beispiel #2
0
 public HomeController(ILogger <HomeController> logger, ApplicationContext contextApp, ArticleContext contextArt, IHubContext <ChatHub> hubContext, IGetArticle getArticle)
 {
     db              = contextArt;
     dbUsers         = contextApp;
     _logger         = logger;
     _getArticle     = getArticle;
     this.hubContext = hubContext;
 }
Beispiel #3
0
        public ArticleInfo(IGetArticle modelObject, bool hideEmptyFields, bool showIcon)
        {
            HideEmptyFields = hideEmptyFields;
            ShowIcon        = showIcon;
            CurrentItem     = modelObject;

            var field = modelObject as ArticleField;

            if (field != null)
            {
                PropertyDisplay pd = new PropertyDisplay()
                {
                    Title = field.FieldDisplayName
                };

                var article = modelObject.GetItem(null);

                if (hideEmptyFields && article == null)
                {
                    return;
                }

                if (article != null)
                {
                    var valueTitleSource = article.Fields.Values.OfType <IGetFieldStringValue>().FirstOrDefault();
                    pd.Value = new ActionLink
                    {
                        CurrentItem = article,
                        ShowIcon    = showIcon,
                        IconClass   = "edit",
                        Title       = valueTitleSource != null ? valueTitleSource.Value : null
                    };
                }

                Content = pd;
            }
        }