Deleting Entities and its Navigation Properties

后端 未结 2 1659
悲哀的现实
悲哀的现实 2021-01-18 08:21

I have something like a Customer object with up to 50000 order in an ICollection. Assume the Custome being in the local cache, the orders not. How

2条回答
  •  抹茶落季
    2021-01-18 08:38

    Simplest approach that I can come up with is to create a cascade delete constraint on the database so that when a customer is deleted all of its orders get deleted as well. Then simply delete the customer on the client and call 'SaveChanges'. In addition, since Breeze does not yet support client side 'cascaded' deletes ( we are considering this one), you will need to iterate over any client side orders that are already loaded and 'detach' them.

提交回复
热议问题