Which code do you need to add?

DRAG DROP
Exhibit:

public class Employee
public int EmployeeID{get. set,)
public string EmployeeName (get set.)
public string City { get. set,)
public byte[] CV (get, set; )
There is MS Visual Studio 2010 and MS .NET Framework 4 application PassGuideApp.
PassGuideApp connects to a MS SQL Server database PassGuideDB.
To obtain data from PassGuideDB ADO.NET LINQ to SQL model is used.
There is a class Employee. See exhibit for definition.
You need to add a collection EmployeeRelatives, with deferred loading, to Employee class.
Which code do you need to add?

DRAG DROP
Exhibit:

public class Employee
public int EmployeeID{get. set,)
public string EmployeeName (get set.)
public string City { get. set,)
public byte[] CV (get, set; )
There is MS Visual Studio 2010 and MS .NET Framework 4 application PassGuideApp.
PassGuideApp connects to a MS SQL Server database PassGuideDB.
To obtain data from PassGuideDB ADO.NET LINQ to SQL model is used.
There is a class Employee. See exhibit for definition.
You need to add a collection EmployeeRelatives, with deferred loading, to Employee class.
Which code do you need to add?

Answer:

Explanation:



Leave a Reply 2

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


John Galt

John Galt

This is a duplicate of question #58, except this one is in C#, while #58 was in Visual Basic.

Also there is a mistake in the specified answer here, here’s the correct one:
public virtual List Employees { get; set; }

They reversed Employee and Employees.

Link verifying correct answer:
http://blogs.msdn.com/b/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx

Declare the property that you would like to load lazily as virtual.

John Galt

John Galt

The screwed up forum removed part of my answer so I’ll post it again:
public virtual List LT Employee GT Employees { get; set; }

Replace LT and GT with less than and greater than signs. The stupid forum does not allow using those.