Question 3
You are developing an application that uses the Microsoft ADO.NET Entity Framework to retrieve order information from a Microsoft SQL Server database. The application includes the following code. (Line numbers are included for reference only.)
The application must meet the following requirements:
You need to ensure that the application meets the requirements.
Which code segment should you insert at line 08?
Where order.OrderDate.Value != null && order.OrderDate.Value.Year >= year
Where order.OrderDate.Value == null && order.OrderDate.Value.Year == year
Where order.OrderDate.HasValue && order.OrderDate.Value.Year == year
Where order.OrderDate.Value.Year == year
Correct answer: A
Explanation:
* For the requirement to use an OrderDate value other than null use:OrderDate.Value != null * For the requirement to use an OrderDate value for this year or a later year use:OrderDate.Value>= year
* For the requirement to use an OrderDate value other than null use:
OrderDate.Value != null
* For the requirement to use an OrderDate value for this year or a later year use:
OrderDate.Value>= year