Error deleting a table row splitted on multiple entities

前端 未结 6 990
耶瑟儿~
耶瑟儿~ 2021-01-06 05:18

I want to delete a table row that is split on two entities.

If I try to delete the main entity, I get an error if before I don\'t load the related other entity using

6条回答
  •  耶瑟儿~
    2021-01-06 05:31

    Possibly load the product like so:

    var product = context.Products.Include(x => x.Photo).First();
    

    Saves a line but will still load the photo from the db.

提交回复
热议问题