Cosmonaut icon indicating copy to clipboard operation
Cosmonaut copied to clipboard

I'm going for EF Core 3.1 for Cosmos Db mapping. Did I miss something?

Open isaacbromberg opened this issue 4 years ago • 4 comments

I'm going for EF Core 3.1 for Cosmos Db mapping. Did I miss something? In a new project, I'm opting for EF Core. The main reason is POCO entities thanks to the good separation of mappings. Or did I miss something in Cosmonaut?

isaacbromberg avatar Feb 04 '20 15:02 isaacbromberg

I didn't quite get the question. Cosmonaut works with POCO entities as well and you can have mappings using attributes if the property name in the POCO is different from the document.

Elfocrash avatar Feb 04 '20 15:02 Elfocrash

Yeah, I know that and assumed that differences between classes and document will happen so I will need attributes.

isaacbromberg avatar Feb 04 '20 15:02 isaacbromberg

Yeah so you can use the [JsonProperty()] attribute to override the name.

Elfocrash avatar Feb 04 '20 16:02 Elfocrash

After a few months with Cosmos DB and one project with EF core, and one project with Cosmonaut I can summarize that way:

  • Ef Core emphasizes mappings
  • Cosmonaut emphasizes JSON serialization

Focus on serialization is more straight forward for the document DB. EF mappings feel aligned to relational DB.

isaacbromberg avatar Apr 10 '20 17:04 isaacbromberg