After generating code with LLBLGen, I added a partial class to extend one of the generated entity classes.
My custom partial class code is as follows :
namespace PPS.DAL.EntityClasses
{
public partial class SettingCatPlacementEntity
{
private string _ForDDSettingName;
public string ForDDSettingName
{
get
{
_ForDDSettingName = this.SettingCatDetails.SName + " | " + this.SettingCatDetails.SettingCategory.ScName;
return _ForDDSettingName;
}
}
}
}
Now I use LLBLGenProDataSource to bind to a asp gridview control. Once I do that VS2008 (possibly VS2005) says error rendering the control. The error displayed in the design view is :
Property accessor 'ForDDSettingName' on object PPS.DAL.EntityClasses.SettingCatPlacementEntity' threw the following exception: 'Object reference not set to an instance of an object'.
Why is this error occuring?
The error occurs only at design time in design view. There is no error at run time. Also the custom property displays correctly in the grid.
Is ther any other consequences or gotchas I need to be aware of when adding custom code this way.
I am using LLBLGen Pro Final 2.5.
I am using SelfServicing two class template. C# and .NET 3.5.