DevForce Help Reference
GenerateId Method


The Entity object for which the new ID will be generated
The EntityProperty in which the new ID will be set
Generates a temporary ID for an IEntity. The temporary ID will be mapped to a real ID when SaveChanges is called.
Syntax
'Declaration
 
Public Function GenerateId( _
   ByVal entity As Object, _
   ByVal entityProperty As DataEntityProperty _
) As UniqueId
'Usage
 
Dim instance As EntityManager
Dim entity As Object
Dim entityProperty As DataEntityProperty
Dim value As UniqueId
 
value = instance.GenerateId(entity, entityProperty)

Parameters

entity
The Entity object for which the new ID will be generated
entityProperty
The EntityProperty in which the new ID will be set
Exceptions
ExceptionDescription
System.ArgumentExceptionIncorrect entity type/property
IdeaBlade.Core.IdeaBladeExceptionIdGenerator not found
Remarks
You must implement the IIdGenerator interface to use ID generation. See the DevForce Developer's Guide for more information on custom ID generation.

If you are using a SQL Server Identity property you do not need to call GenerateId for the property.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityManager Class
EntityManager Members
IIdGenerator Interface

Send Feedback