FoxLearn.JsonLd 1.1.3

dotnet add package FoxLearn.JsonLd --version 1.1.3
                    
NuGet\Install-Package FoxLearn.JsonLd -Version 1.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FoxLearn.JsonLd" Version="1.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FoxLearn.JsonLd" Version="1.1.3" />
                    
Directory.Packages.props
<PackageReference Include="FoxLearn.JsonLd" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FoxLearn.JsonLd --version 1.1.3
                    
#r "nuget: FoxLearn.JsonLd, 1.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FoxLearn.JsonLd@1.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FoxLearn.JsonLd&version=1.1.3
                    
Install as a Cake Addin
#tool nuget:?package=FoxLearn.JsonLd&version=1.1.3
                    
Install as a Cake Tool

๐Ÿ”ท FoxLearn.JsonLd - Structured Data for .NET

FoxLearn.JsonLd is a lightweight .NET library that provides strongly-typed C# POCO classes for working with JSON-LD and Schema.org structured data. It enables easy serialization of semantic metadata in your web applications to boost SEO, enhance search engine visibility, and improve content discoverability.


โœ… Key Features

  • ๐Ÿš€ SEO Optimization: Easily embed structured metadata into your HTML to power rich results on Google, Bing, and more.
  • ๐Ÿ”ง ASP.NET Core Integration: Generate JSON-LD output directly from your backend logic.
  • ๐Ÿงฉ Schema.org Support: Full support for Schema.org types like Organization, WebSite, WebPage, BreadcrumbList, and more.
  • ๐Ÿ“ฆ Clean Serialization: Output standards-compliant JSON-LD using System.Text.Json.

๐Ÿ“ฅ Installation

Install via the .NET CLI:

dotnet add package FoxLearn.JsonLd

Or search for FoxLearn.JsonLd in the NuGet UI inside Visual Studio.

๐ŸŒ What is Schema.org?

Schema.org is a collaborative community that creates, maintains, and promotes schemas for structured data on the Internet. Search engines like Google, Bing, Yandex, and Yahoo use this data to improve search listings with rich results such as:

  • Product ratings

  • Event details

  • Course listings

  • Breadcrumbs

  • Organization contact info

๐Ÿ”Ž Where is Schema.org Used?

Websites

Structured data based on Schema.org can be embedded in the <head> section of HTML pages to enable search engines to display rich, enhanced results. For example, Google may show extended metadata about your website directly in search results when structured data is present.

Example:

To include structured data in an HTML page, you can use a <script> tag with the MIME type application/ld+json.

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "url": "https://foxlearn.com",
  "name": "FoxLearn",
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+1-400-444-1711",
    "contactType": "Customer service"
  }
}
</script>

This allows search engines like Google to better understand your content and display enhanced search results accordingly.

๐Ÿงช Usage Guide

โœ… Basic Example: Organization

using FoxLearn.JsonLd;
using FoxLearn.JsonLd.Schema;
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Json.Serialization;

var org = new Organization()
{
    Name = "FoxLearn",
    Url = new Uri("https://foxlearn.com"),
    LegalName = "FoxLearn",
    Logo = new Uri("https://foxlearn.com/img/logo.png"),
    Description = "Welcome to foxlearn.com! This site is a blog about everything that matters in the world of programming.",
    ContactPoint = new List<ContactPoint>()
    {
        new ContactPoint() { ContactType = "Customer Service", Name = "Tan Lee", Email = "example@gmail.com"}
    },
    Founder = new List<IPerson>()
    {
        new Person() { Name = "Tan Lee"}
    },
    FoundingDate = new Date(2016, 01, 01),
    Email = "example@gmail.com",
};

string json = JsonLdSerializer.Serialize(org);

Console.WriteLine(json);

Embed in your Razor view:

@Html.Raw(json)

This outputs:

{
    "@type": "Organization",
    "email": "example@gmail.com",
    "founder": {
      "@type": "Person",
      "name": "Tan Lee"
    },
    "foundingDate": "2016-01-01",
    "legalName": "FoxLearn",
    "contactPoint": {
      "@type": "ContactPoint",
      "email": "example@gmail.com",
      "contactType": "Customer Service",
      "name": "Tan Lee"
    },
    "logo": "https://foxlearn.com/img/logo.png",
    "url": "https://foxlearn.com",
    "name": "FoxLearn",
    "description": "Welcome to foxlearn.com! This site is a blog about everything that matters in the world of programming."
}

๐Ÿ“˜ Advanced Usage: Rich Page Metadata

Here's a more complex example using SchemaRoot to generate structured data for a full web page including images, breadcrumbs, and actions.


var root = new SchemaRoot();

var page = new WebPage()
{
    Id = "https://foxlearn.com/course/asp-net-core-tutorials/",
    Url = new Uri("https://foxlearn.com/course/asp-net-core-tutorials/"),
    Name = "ASP.NET Core Tutorials For Beginners",
    IsPartOf = new WebSite()
    {
        Id = "https://foxlearn.com/#website"
    },
    PrimaryImageOfPage = new ImageObject()
    {
        Id = "https://foxlearn.com/course/asp-net-core-tutorials/#primaryimage"
    },
    Image = new ImageObject()
    {
        Id = "https://foxlearn.com/course/asp-net-core-tutorials/#primaryimage"
    },
    ThumbnailUrl = new Uri("https://foxlearn.com/wp-content/uploads/2025/01/ASP.NET-Core-Tutorials-1.png"),
    DatePublished = new Date("2025-01-12T04:04:22+00:00"),
    Description = "These ASP.NET Core Tutorials are designed for beginners as well as professionals developers who want to learn ASP.NET Core.",
    Breadcrumb = new BreadcrumbList()
    {
        Id = "https://foxlearn.com/course/asp-net-core-tutorials/#breadcrumb"
    },
    InLanguage = "en-US",
    PotentialAction = new ReactAction()
    {
        Target = new Uri("https://foxlearn.com/course/asp-net-core-tutorials/")
    }
};
root.Graph.Add(page);

ImageObject image = new ImageObject()
{
    Id = "https://foxlearn.com/course/asp-net-core-tutorials/#primaryimage",
    Url = new Uri("https://foxlearn.com/wp-content/uploads/2025/01/ASP.NET-Core-Tutorials-1.png"),
    ContentUrl = new Uri("https://foxlearn.com/wp-content/uploads/2025/01/ASP.NET-Core-Tutorials-1.png"),
    InLanguage = "en-US",
    Width = 908,
    Height = 203,
    Caption = "ASP.NET Core Tutorials For Beginners and Professionals"
};
root.Graph.Add(image);

BreadcrumbList breadcrumb = new BreadcrumbList()
{
    Id = "https://foxlearn.com/course/asp-net-core-tutorials/#breadcrumb",
    ItemListElement = new[]
    {
        new ListItem() { Position = 1, Name = "Home", Item = new Uri("https://foxlearn.com") },
        new ListItem() { Position = 2, Name = "Courses", Item = new Uri("https://foxlearn.com/courses/") },
        new ListItem() { Position = 3, Name = "ASP.NET Core Tutorials For Beginners and Professionals" },
    }
};
root.Graph.Add(breadcrumb);

WebSite webSite = new WebSite()
{
    Id = "https://foxlearn.com/#website",
    Url = new Uri("https://foxlearn.com"),
    Name = "FoxLearn",
    InLanguage = "en-US",
    Publisher = new Person()
    {
        Id = "https://foxlearn.com/#/schema/person/072a2d877405716353aa607e372bc216"
    },
    PotentialAction = new SearchAction()
    {
        Target = new EntryPoint()
        {
            UrlTemplate = "https://foxlearn.com/post/search/?q={search_term_string}"
        },
        QueryInput = new PropertyValueSpecification()
        {
            ValueRequired = true,
            ValueName = "search_term_string"
        }
    }
};

root.Graph.Add(webSite);

string json = JsonLdSerializer.Serialize(root);
Console.WriteLine(json);

๐Ÿš€ Benefits of Using FoxLearn.JsonLd

  • Better search performance: Appear in Google's rich cards and knowledge panels.

  • Higher click-through rates: Enhanced listings draw more attention.

  • Semantic clarity: Improve how your content is interpreted by AI tools and bots.

  • Clean, reusable code: Avoid manual JSON construction and validation.

๐Ÿ”’ License

This project is licensed under the MIT License. Free for personal and commercial use.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on FoxLearn.JsonLd:

Package Downloads
FoxLearn.AspNetCore.JsonLd

A lightweight .NET library that automatically inserts <script> tags with the MIME type application/ld+json into the <head> of your HTML to help search engines better understand and index your content.

FoxLearn.AspNet.JsonLd

A lightweight .NET library that automatically inserts <script> tags with the MIME type application/ld+json into the <head> of your HTML to help search engines better understand and index your content.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.3 149 6/19/2025
1.1.2 136 6/19/2025
1.1.1 152 6/18/2025
1.1.0 173 6/14/2025
1.0.5 260 6/13/2025
1.0.4 296 6/12/2025
1.0.3 294 6/12/2025
1.0.2 229 6/9/2025
1.0.1 110 6/6/2025
1.0.0 92 6/6/2025