Пример #1
0
        public InfoLiecViewModel ContentModelToInfoLiecViewmodel(ContentModel c)
        {
            var info = new InfoLiecViewModel
            {
                Id               = c.Id.ToString(),
                Context          = c.Context,
                DarkTheme        = c.GetTheme().DarkColorCode,
                CreationDate     = c.CreationDate.ToShortDateString(),
                ModificationDate = c.ModificationDate.ToShortDateString(),
                LightTheme       = c.GetTheme().LightColorCode,
                NormalTheme      = c.GetTheme().NormalColorCode,
                Sources          = c.Sources,
                Tags             = c.Tags,
                Theme            = c.Theme.ToString(),
                Title            = c.Title,
                Text             = c.Text,
                Image            = c.ImagePath,
                TwitterUrl       = String.IsNullOrEmpty(c.TwitterUrl) ? "https://twitter.com/instantencommun?lang=fr" : c.TwitterUrl,
                FacebookUrl      = String.IsNullOrEmpty(c.FacebookUrl) ? "https://fr-fr.facebook.com/Linstantencommun/" : c.FacebookUrl,
                InstagramUrl     = String.IsNullOrEmpty(c.InstagramUrl) ? "https://www.instagram.com/instantencommun/" : c.InstagramUrl,
                Creator          = c.InstagramUrl
            };

            return(info);
        }