it doesn't work with me despite i made exactly like documentation....when i make a master it completed good but child it gives me a lot of errors while migration
1- says (Error occurred on DB migration step! Make sure the project is compiled and working. Command output: Build started... Build failed. Use dotnet build to see the errors.)
2- when open the code i found property [ public Guid OrderId ] twice ???? why ????
3- In folder orderDbSet it gives me an error with namespace
-
ABP Framework version: 8.0.0
-
UI Type: MVC
-
Database System: EF Core (SQL Server)
-
Exception message and full stack trace:
3 Answer(s)
-
0
Hi, it seems you have added
OrderId
as either as a property or to establish a one-to-many relationship with theOrder
entity in your child entity (OrderLine
in this example). You don't need to establish one to many relationships, the master-child relationship is enough for the relation, otherwise, it's normal to seeOrderId
as duplicated.OrderLine.cs
OrderLineDto.cs
So, your
OrderLine
entity definition should be as follows:If you want you can establish one-to-many relationship with other entities, but not with the master entity.
-
0
Thank you it works perfectly
but i have another question if the child and master is enough why do you put (Navigation tab and 1-n relation)?? -
0
Thank you it works perfectly
but i have another question if the child and master is enough why do you put (Navigation tab and 1-n relation)??You can establish a relationship with another entity (except the master entity itself). For example, you can have
Order
,OrderLine
, andProduct
entities and want to establish a one-to-many relationship betweenOrderLine
andProduct
(OrderLine can have multiple products). In this case, it's useful and needed for your use case.I close the question since your question is answered. Please create a new ticket, if you have further questions.
Best regards.