Question 5


Question

Multiple Choice

You are developing an applicaton that uses the Microsoo ADO.NET Entty Framework to retrieve order informaton from a Microsoo SQL Server database. The applicaton includes the following code. (Line numbers are included for reference only.)

The applicaton must meet the following requirements:

  1. Return only orders that have an OrderDate value other than null.
  2. Return only orders that were placed in the year specifed in the OrderDate property or in a later year.
  3. You need to ensure that the applicaton meets the requirements.
Which code segment should you insert at line 08?

  • A. Where order.OrderDate.Value != null && order.OrderDate.Value.Year >= year
  • B. Where order.OrderDate.Value == null && order.OrderDate.Value.Year == year
  • C. Where order.OrderDate.HasValue && order.OrderDate.Value.Year == year
  • D. Where order.OrderDate.Value.Year == year

Answer:

A