hi,
i'm learning EF4 and would like someone to recommend the best practice on how to search for entities using complex criteria in a stored procedure and return entities and their navigation properties.
So lets say i have a table for Customer and a table for Contact. A customer can have many contacts. The customer table contains the CustomerID and Company name, while the Contact table contains the name and email address. This is an over simplification of what there actually is and in fact i need to keep using a storedprocedure for the search as it is also doing an approximate string matching.
the SP returns the customer columns only and includes a column to indicate the score of each search result.
the question is, how would i capture the result into the Customer Entity while still capturing the score?
Also, is there a way to load the contacts (which is a navigation property of the customer entity) in the same call? and if possible in case when the search is by email address it returns the customer but with only the contact with that email address?