In "Using The IObjectHelper Interface"
http://longhorn.msdn.microsoft.com/lhsdk/ndp/daconsampleusingiobjecthelperinterface.aspx
there is a example including only simple fields/properties. When using
IObjectHelper in classes where the type of the fields are objects,
what to return: the object or the simple type (valueType) of the
object key?
Example: (property Department)
public class Employee : IObjectHelper
{
private int p_Id = 0;
public string LastName;
public string FirstName;
public Department Department;
public object this[string propertyName]
{
get
{
switch (propertyName)
{
case "p_Id":
return this.p_Id;
case "FirstName":
return this.FirstName;
case "LastName":
return this.LastName;
case "Department":
return Department; //Or return the Department identification
(Int32)?
default:
throw new SystemException("Property " + propertyName + " not
found.");
}
}
}
Thanks
E M