title: Structured Data JSON ld in asp c#
body: <p>I am looking to add structure data script via json ld to a c# asp.net web application.</p>
  
  <p>Here is the structured data script I am looking to add. I am getting runtime errors because of the @ conflict with c#: <code>The name 'context' does not exist in the current context</code>...this is obviously due to the @ syntax conflict.</p>
  
  <p>What is an easy way to get around this?</p>
  
  <blockquote>
  <pre><code>&lt;script type="application/ld+json"&gt;
  {
  "@context": "http://schema.org",
  "@type": "LegalService",
  "image": "https://example.com.png",
  "@id": "https://example.com",
  "name": "Example Name",
  "description": "Example description.",
  "address": {
  "@type": "PostalAddress",
  "streetAddress": "Example Address",
  "addressLocality": "Example City",
  "addressRegion": "Example State",
  "postalCode": "Example Postal",
  "addressCountry": "Example Country"
  },
  "url": "https://example.com",
  "telephone": "Example number",
  "sameAs": [
  "example social account 1",
  "example social account 2"
  ]
  }
  &lt;/script&gt;
  </code></pre>
  </blockquote>
  
  <p>So it looks like the way around this, thanks to @scartag, is to add a double @. </p>
  
  <p>I am also trying to add a loop inside the script, but I'm getting runtime errors. I'm not sure if this is even possible. It is for blog articles that will be generated in the CMS.</p>
  
  <p>See below:</p>
  
  <pre><code>&lt;script type="application/ld+json"&gt;
  {
    "@@context": "http://schema.org",
    "@@type": "NewsArticle",
    "mainEntityOfPage": {
      "@@type": "WebPage",
      "@@id": "https://google.com/article"
    },
    @foreach (var post in recent)
      {
    "headline": "Article headline",
    "image": {
      "@@type": "ImageObject",
      "url": "https://google.com/thumbnail1.jpg",
      "height": 800,
      "width": 800
    },
    "datePublished": "2015-02-05T08:00:00+08:00",
    "dateModified": "2015-02-05T09:20:00+08:00",
    "author": {
      "@@type": "Person",
      "name": "John Doe"
    },
     "publisher": {
      "@@type": "Organization",
      "name": "Google",
      "logo": {
        "@@type": "ImageObject",
        "url": "https://google.com/logo.jpg",
        "width": 600,
        "height": 60
      }
    },
    "description": "A most wonderful article"
  }
  }
  &lt;/script&gt;
  </code></pre>