Need C# code for below code

Posts   
 
    
Posts: 4
Joined: 26-Aug-2008
# Posted on: 05-Sep-2008 10:56:57   

Hi all,

I just tried to convert the below code into C#.

But it gives the error 'Method name expected' at 'EntityFieldsFactory' term.

EntityFieldsFactory.CreateEntityFieldsObject(EntityType.SizeEntity)(CStr(entry.Key))

Please help by giving the C# code for the code.

Thanks in advance.

Regards,

Selvakumar Govindasamy.

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 05-Sep-2008 11:10:57   

EntityFieldsFactory.CreateEntityFieldsObject(EntityType.SizeEntity); Just make sure the name is resolved (the appropriate namespace is declared in a using statement).

Posts: 4
Joined: 26-Aug-2008
# Posted on: 05-Sep-2008 11:33:38   

Walaa wrote:

EntityFieldsFactory.CreateEntityFieldsObject(EntityType.SizeEntity); Just make sure the name is resolved (the appropriate namespace is declared in a using statement).

Thanks for ur reply..

I just wanna convert the "entry.Key" into the IEntityField2.For that purpose i am using the code.

 EntityFieldsFactory.CreateEntityFieldsObject(EntityType.SizeEntity)(CStr(entry.Key))

Is there any possibilities?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 05-Sep-2008 13:41:38   

What does "entry.Key" hold for a value?

Posts: 4
Joined: 26-Aug-2008
# Posted on: 05-Sep-2008 14:04:01   

It is a String...

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-Sep-2008 21:28:01   
IEntityField2 field = EntityFieldsFactory.CreateEntityFieldsObject(EntityType.SizeEntity)[entry.Key];
David Elizondo | LLBLGen Support Team