Adding More Information When a New Entity Gets Created

Applications are usually required to add new default information whenever a new entity gets added. This can be accomplished easily by overriding the NewEntity() method. Make sure however, that you do call the default behavior!

VB.NET:

Protected Overrides Sub NewEntity(ByVal biz As EPS.Business.BusinessObjects.IBusinessObject ) MyBase.NewEntity(biz) Me.Name = "New Product" End Sub

C#:

protected override void NewEntity(IBusinessObject biz) { base.NewEntity (biz); this.Name = "Another new product" ; }


Note: Similar operations can be performed when the object needs to be saved. Simply overwrite the Save() method.


Last Updated: 8/7/2006