---
title: Synchronize content
slug: graph/docs/sync-content
docTags: 
createdAt: 2026-07-30T20:30:19.480Z
---

:::hint{type="info"}
**Note**
Optimizely Graph .NET Source SDK is optimized for CMS 12. Learn more about the [C# SDK for CMS 13](docId\:ZQSzbbACAIXmzMLIe4NIk).
:::

After completing the steps in the [Get started](docId\:Jb6E4MafgLYifo6YMn2V9) and [Content types](docId\:sNcLLcLYgWv_QVb0Mtqus) articles, sync your content with Optimizely Graph.

## Sync your content

To sync content, create an instance of your class object and pass it to the client. The following code example uses the `Cafe` class from the [get started](docId\:Jb6E4MafgLYifo6YMn2V9) article:

```csharp
var exampleDataInstance1 = new Cafe
{
    Name = "Optimizely's Awesome Cafe",
    Established = new DateTime(2024, 06, 12),
    Address = new Location
    {
        City = "New York",
        State = "NY",
        Zipcode = "10003",
        Country = "USA"
    },
    Menu = new Menu
    {
        Beverages = new List<Beverage>
        {
            new() {
                Name = "Espresso",
                Price = 4.99,
                Sizes = new[] { "S", "M" }
            },
            new() {
                Name = "Latte",
                Price = 5.99,
                Sizes = new[] { "M", "L" }
            },
            new() {
                Name = "Cappuccino",
                Price = 6.99,
                Sizes = new[] { "S", "M", "L" }
            }
        },
        Food = new List<FoodItem>
        {
            new() {
                Name = "Bagel",
                Price = 5.25,
                IsAvaiable = true
            },
            new() {
                Name = "Croissant",
                Price = 3.89,
                IsAvaiable = true
            },
            new() {
                Name = "Cinnamon Roll",
                Price = 4.99,
                IsAvaiable = false
            }
        }
    }
};
```

### Assign unique IDs

Each data instance requires a unique ID for identification and updates. The following example uses the cafe name and address to generate an ID. Use the `SaveContentAsync` method to push your content.

```csharp
await client.SaveContentAsync(
    generateId: (x) => $"{x.Name}_{x.Address.City}", 
    exampleDataInstance1
);
```

:::hint{type="info"}
**Note**
Pushing content with an ID that exists in Optimizely Graph overwrites the existing content.
:::

### Push multiple objects

The .NET Source SDK syncs multiple objects in a single call when you pass an array of data instances. The following code example uses a comma-separated parameter list:

```csharp
await client.SaveContentAsync(
    generateId: (x) => Guid.NewGuid().ToString(), 
    exampleDataInstance1,
    exampleDataInstance2,
    //and so on
);
```

## Verify data

After completing the previous steps, go to the [interactive GraphiQL page](https://cg.optimizely.com/app/graphiql) to run queries and retrieve your synced data. See [Access the interactive GraphiQL page](docId\:SKZx_xA5w2geOH6iwyRJF) for instructions.

:::hint{type="info"}
**Note**
Remember to add your `singlekey` to the query parameter to access the GraphiQL page.
:::
