Cosmos: API to materialize entities from raw JSON data
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
### What problem are you trying to solve?
When working with Azure Cosmos DB, you might interact with cosmos db directly (outside of EF) but still want to deserialize the document to an entity.
For example, when using the change feed processor:
```
var client = context.Database.GetCosmosClient();
var container = client.GetContainer(
context.Database.GetCosmosDatabaseId(),
context.Model.GetEntityTypes().Single().GetContainer());
var processor = container.GetChangeFeedProcessorBuilder("processor", async (IReadOnlyCollection changes, CancellationToken ctx) =>
{
foreach (var change in changes)
{
// Deserialize to entity?
}
}).WithInMemoryLeaseContainer().Build();
```
### Describe the solution you'd like
Some way to deserialize documents to entity types
Contributor guide
Assessment
This issue has not been assessed yet.