I have my Recipe and Ingredient entity.
Then I've created a Ingredient CRUD, easy just a name and Id.
The problem is when create a Recipe CRUD, with a list o ingredients, and each one have a quantity.
If I include a property Quantities to Ingredient Entity I can't avoid to feel it's dirty, Ingredients should don't know anything about it.
My idea is to create another object that wraps Ingredient + Quanitity.
My problem is not with neo4j graph modeling. My real problem is how to map this graph with C# DDD domain.
@Bennu this looks fine, but this way i think I'm breaking the DDD and Isolation principle.
My domain should represent the business logic and not the database logic.
Currently I have 3 layers: Api, Domain, DataAccess.
I'm using repository pattern to communicate domain and DataAccess ( Interfaces in domain, implementations in dataAccess)
I think I will create models in DataAccess layer and then map this models to my domain entities.
This way I'm isolating my domain from database framework and if in the future i want to move to Entity Framework or some other database I can do it without breaking my domain.
That's the right approach! (according to me so don't trust me )
I'm working with DDD for project (java based) and during POC stage, while comparing Neo4J and another DB, we stablished the domain objects mainly as our DTO with few variations for small agreggations/denormalizations (against DDD but pro bussiness requirements). Our DAO objects were built for both DB's using correspondants CrudRepositories. So yes, they are 'linked' to the DB technology but you can port the whole Domain by just changing this objects (you can even keep the same DAO-DTO converter). So this way we had the same service able to work with both DBs.
I hope I explained my thoughts! Did you read the links suggested by @asperlinga? They are quite interesting. The don't have the concept of quantity tho but worth reading.