Closed criss02-cs closed 1 year ago
this sounds like you should use embedded entities for HalfDamage
property instead of referenced entities.
but if you must make it a referenced relationship, you should do it without exposing your data entities to the frontend world. frontend models should be mapped to data entities and vise versa.
here's a sample project showing how i'd personally do it: OneToManySample.zip
I'm trying to update a model with asp.net core but when i pass the json below it throws a new NotSupportedException : The collection type 'MongoDB.Entities.Many' is abstract, an interface, or is read only, and could not be instantiated and populated property, i have to insert more elements inside that, but i don't know how to do
{ "name": "Acqua", "halfDamage": [ { "id": "64498df00820884387341f72", "name": "Fuoco" } ] }
HalfDamage is a Many