How to Fetch an exiting entity?

Posts   
 
    
Darwin avatar
Darwin
User
Posts: 38
Joined: 12-Apr-2005
# Posted on: 05-May-2005 01:32:43   

I am fetching an entity... and I need to fetch a related entity.... It just so happens the related entity (record) doesn't exist.... that's ok, but when I use FetchNewEntity(...) to get the entity from the database I appear to get a new record instead of no records at all. How do I make it so if the data doesn't exist, I get nothing back? And how do I detect that I am in this situation?

Thanks, Darwin

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 05-May-2005 11:06:14   

the returned entity.Fields.State isn't EntityState.Fetched if the entity wasn't found in the database.

Frans Bouma | Lead developer LLBLGen Pro