Seed entity with owned property

后端 未结 5 1996
深忆病人
深忆病人 2021-02-12 13:41

I am trying to seed an user entity in my database. The User entity has an owend property EmailPermissions.

When I run the command

5条回答
  •  一整个雨季
    2021-02-12 14:30

    If you want to avoid using an anonymous type to specify the shadow property keys, you can declare them explicitly in your model class and configure them with the Fluent API as keys. This way you don't have to guess the property names and it's less error-prone.

    If the name supplied to the Property method matches the name of an existing property (a shadow property or one defined on the entity class), then the code will configure that existing property rather than introducing a new shadow property. Source

提交回复
热议问题