| Milos How-To |
| How Do You Use This Object? (Business Entity) |
Dim oEnt As New ProductBusinessEntity ()
Load an existing entity:
Dim oEnt As New ProductBusinessEntity (PK)
Save a new or modified entity:
oEnt.Save()
Figure out whether an entity needs saving:
if oEnt.IsDirty...
Query the primary key of the entity:
Guid guidKey = oEnt.PK;
Delete the current business object:
eEnt.Remove()
Note that after removing an entity, the Save() method needs to be called to actually cause the operation on the server. Note also that after calling the Remove() object, the business entity is no longer valid and one should not interact with it in any way, other than calling the Save() method.