In Entity Framework, the ________ Data Annotation is used to exclude a property from the database schema.

  • NotMapped
  • ExcludeFromDB
  • ExcludeFromSchema
  • IgnoreProperty
The correct option is Option 1: NotMapped. This data annotation is used to specify that a property should be excluded from the database schema. It is typically applied to properties that are not mapped to any database table column, such as calculated properties or properties used for internal processing within the application. Using NotMapped prevents Entity Framework from attempting to create a corresponding column in the database.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *