IdeaBlade DevForce 2010 Help Reference
GenerateId Method
See Also  Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityManager Class : GenerateId Method



entity
The Entity object for which the new ID will be generated
entityProperty
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 EntityManager.SaveChanges is called.

Syntax

Visual Basic (Declaration) 
Public Function GenerateId( _
   ByVal entity As Object, _
   ByVal entityProperty As DataEntityProperty _
) As UniqueId
Visual Basic (Usage)Copy Code
Dim instance As EntityManager
Dim entity As Object
Dim entityProperty As DataEntityProperty
Dim value As UniqueId
 
value = instance.GenerateId(entity, entityProperty)
C# 
public UniqueId GenerateId( 
   object entity,
   DataEntityProperty entityProperty
)
C++/CLI 
public:
UniqueId^ GenerateId( 
   Object^ entity,
   DataEntityProperty^ 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 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.