Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using IObjectHelper

2 views
Skip to first unread message

Engesoft

unread,
Jul 21, 2004, 12:33:34 PM7/21/04
to
Hi,

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

0 new messages