How to load an entity of a known type

Jul 15, 2009 at 11:46 AM

Hi,

Can I load an entity (only one) from xml using its ConvertNamespaceDomainToEuss name and looping it? (I wouldn't like to load the XML file directly...)

Regards,

Josep Balague

 

 

Coordinator
Jul 15, 2009 at 2:28 PM

Hi,

 

You can use the LoadSingle<T> method on the object context. Since you know the type, you should not need anything else. This method gives you an object of the type you required. Thus, you can do everything you want with that object. However, be careful if you loop on references you may experience some performance issues because of the lazy loading.

Regards,

Nicolas Penin

Jul 16, 2009 at 7:48 AM

Hi Nicolas,

thanks for your reply.

I tried Load<T> and LoadSingle<T> on an empty table or the constraint is forced with invalid value and in both test these methods returned a null entity. It could be forced to return a T type with all its members... (something like SELECT TOP 0 * FROM .... or SELECT * FROM .... WHERE 1=0).

 

Coordinator
Jul 16, 2009 at 8:23 AM
Hi Josep,

Euss is "only" a persitence framework. If you have not persisted anything, you cannot retrieve what you have not stored.

2009/7/16 jmroyb <notifications@codeplex.com>

From: jmroyb

Hi Nicolas,

thanks for your reply.

I tried Load<T> and LoadSingle<T> on an empty table or the constraint is forced with invalid value and in both test these methods returned a null entity. It could be forced to return a T type with all its members... (something like SELECT TOP 0 * FROM .... or SELECT * FROM .... WHERE 1=0).

 

Read the full discussion online.

To add a post to this discussion, reply to this email (euss@discussions.codeplex.com)

To start a new discussion for this project, email euss@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
Cordialement,
Nicolas Penin