Ejemplo n.º 1
0
        public string ToHtmlString()
        {
            if (!Title.IsNullOrWhiteSpace())
            {
                _builder.Append($"<meta property=\"og:title\" content=\"{Title}\" />");
                _builder.Append(Environment.NewLine);
            }

            if (!SiteName.IsNullOrWhiteSpace())
            {
                _builder.Append($"<meta property=\"og:site_name\" content=\"{SiteName}\" />");
                _builder.Append(Environment.NewLine);
            }

            if (!Type.IsNullOrWhiteSpace())
            {
                _builder.Append($"<meta property=\"og:type\" content=\"{Type}\" />");
                _builder.Append(Environment.NewLine);
            }

            if (!Description.IsNullOrWhiteSpace())
            {
                _builder.Append($"<meta property=\"og:description\" content=\"{Description}\" />");
                _builder.Append(Environment.NewLine);
            }

            if (!Url.IsNullOrWhiteSpace())
            {
                _builder.Append($"<meta property=\"og:url\" content=\"{Url}\" />");
                _builder.Append(Environment.NewLine);
            }

            if (!Image.IsNullOrWhiteSpace())
            {
                _builder.Append($"<meta property=\"og:image\" content=\"{Image}\" />");
                _builder.Append(Environment.NewLine);
            }

            return(_builder.ToString());
        }