In Entity Framework, a property can be marked as required using the ________ Data Annotation or Fluent API.

  • ForeignKey
  • Index
  • Key
  • Required
In Entity Framework, the [Required] data annotation or .IsRequired() method in the Fluent API can be used to specify that a property in a model is required, meaning it cannot be null. This ensures data integrity and helps enforce business rules.
Add your answer
Loading...

Leave a comment

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