<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/azure-cosmos-db-container-items-and-generics-4u3cj5vy9" -->

---
title: Azure Cosmos DB: container items and generics | daily.dev
description: This post explores how to store and retrieve different types of objects in an Azure Cosmos DB Container using C# and generics. It also covers the process of...
canonical: https://daily.dev/posts/azure-cosmos-db-container-items-and-generics-4u3cj5vy9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Azure Cosmos DB: container items and generics | daily.dev
og:description: This post explores how to store and retrieve different types of objects in an Azure Cosmos DB Container using C# and generics. It also covers the process of...
og:url: https://daily.dev/posts/azure-cosmos-db-container-items-and-generics-4u3cj5vy9
og:image: https://api.daily.dev/og/posts/4U3cj5vY9.png
og:image:alt: Azure Cosmos DB: container items and generics
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Cosmos DB: container items and generics

**[John Reilly](https://daily.dev/sources/johnnyreilly)** · 5 min read · 2 upvotes · 0 comments

## Summary

This post explores how to store and retrieve different types of objects in an Azure Cosmos DB Container using C# and generics. It also covers the process of deserializing the 'data' property using JSON.NET and System.Text.Json.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://johnnyreilly.com/azure-cosmosdb-container-item-generics>

---

Tags: [#c#](https://daily.dev/tags/c#), [#azure-cosmos-db](https://daily.dev/tags/azure-cosmos-db)

[View this post on daily.dev](https://daily.dev/posts/azure-cosmos-db-container-items-and-generics-4u3cj5vy9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Azure Cosmos DB: container items and generics","url":"https://daily.dev/posts/azure-cosmos-db-container-items-and-generics-4u3cj5vy9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/azure-cosmos-db-container-items-and-generics-4u3cj5vy9"},"datePublished":"2024-04-02T19:37:28.498Z","dateModified":"2024-05-09T08:43:33.910Z","description":"This post explores how to store and retrieve different types of objects in an Azure Cosmos DB Container using C# and generics. It also covers the process of...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6e544c2ae3935076447de9fd0dfa882a?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6e544c2ae3935076447de9fd0dfa882a?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"John Reilly","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"John Reilly","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/c1915bb9b8334d82853ec8e5f3a9532f","url":"https://daily.dev/sources/johnnyreilly"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/azure-cosmos-db-container-items-and-generics-4u3cj5vy9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c#,azure-cosmos-db","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"John Reilly","item":"https://daily.dev/sources/johnnyreilly"},{"@type":"ListItem","position":3,"name":"Azure Cosmos DB: container items and generics"}]}
```

