DeleteEntitiesDirectly and EntityName

Posts   
 
    
exp2000
User
Posts: 68
Joined: 13-Apr-2006
# Posted on: 19-Sep-2006 20:38:40   

Ok, so I need to have instance of the entity before I can use this method? How do I get this name without having to have and instance of the actuall entity? Shouldn't generated entities have a shared (static) property with entity name so that I do not have to use "xxxEntity" but rather xxxEntity.Name. This would prevent errors if entity name has been changed.

Any suggestions.

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 19-Sep-2006 23:11:16   
exp2000
User
Posts: 68
Joined: 13-Apr-2006
# Posted on: 20-Sep-2006 19:31:04   

I read that post before asking a question, and a question still stands. That is not a static property of the xxxentity. You have to get instance before using it. Just doing xxxEntity. does not produce that property in intelisense.

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 21-Sep-2006 07:10:22   

Woops...good point - that could be static I suppose. (Sorry....)

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 21-Sep-2006 08:35:53   

It can't be static, because it has to be overriden by derived entities, hence an instance variable.

Creating an instance of a class is very fast in .NET, so I really wouldn't make a big deal out of this, especially because the framework also creates instances under the hood sometimes to retrieve meta-data/other data.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 24-Sep-2006 19:22:45   

Exp2000, You could create a static method in a derrived class of 'GetEntityName'. That would simply instantiate the entity and return the instance variable....