Hi There,
We are creating some entities in Entity Framework. It is not associate to any Database means we create blank edmx file and adding new Entity in the same. We create new entity with name AuditData which contains following fields.
Scalar Property : Type
FieldName : string
CreateDate : DateTime
CreatedBy : Int
UpdatedDate : DateTime
UpdatedBy : Int
But when I am trying to save this entity, it Run custom tool automatically and give following error.
Error 1 Running transformation: EntityType 'EntityModel.AuditData' has no key defined. Define the key for this EntityType. .\..\Model\EntityModel.edmx
After that I add new property by name ID and mark it as EntityKey. After that it generates class successfully, which I don't require in this entity. Can please how I can avoid this error without adding any key in entity.
Ankush