O'Reilly logo

Code-First Development with Entity Framework by Sergey Barskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Self-test questions

Q1. You would like to define a column to store a number without a fractional value, but you want to make the value optional. What .NET type should you use for such property?

  1. Decimal
  2. Decimal?
  3. Int
  4. Int?

Q2. If you want to make the first name column to be non-nullable in the database, you can rely on default conventions in Entity Framework and avoid all configuration, true or false?

Q3. You cannot override conventions that are preloaded with Entity Framework, such as the one that makes all foreign key constraints be setup to cascade on delete, true or false?

Q4. Which of the following is not a type of relationship?

  1. One-to-Many
  2. Many-to-Many
  3. One-or-Zero-to-Many
  4. Many-to-Default

Q5. The best way to configure all properties in all classes is to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required