Wednesday, May 26, 2010

Data delay load and the Special Bind Table

Data delay load and the Special Bind Table
Code:

namespace BusinessLogic.BusinessObject
{
[Serializable]
[System.Data.Linq.Mapping.Table(Name = "Task")]
public class BusiTask : KLimsCore.Model.Task
{
private BusiSampleCollection busiSamples;
public BusiSampleCollection BusiSamples
{
get
{
if (busiSamples == null)
{
busiSamples = new BusiSampleCollection();
if (this.ID != 0)
{
busiSamples.FillCollection("TaskID=" + this.ID.ToString());
}
}
return busiSamples;
}
set
{
busiSamples = value;
}
}
public override string GetTableName()
{
return base.GetTableName();
}
}
}

Important in:

get
{
if (busiSamples == null)
{
busiSamples = new BusiSampleCollection();
if (this.ID != 0)
{
busiSamples.FillCollection("TaskID=" + this.ID.ToString());
}
}
return busiSamples;
}

In Addition:

[System.Data.Linq.Mapping.Table(Name = "Task")]

It's point which Table for bind the code.
http://anforen.5d6d.com

No comments:

Search This Blog

Followers