|
Say we have the entity Customer { FirstName, LastName, Age } and the following query:
We are only interested in select and displaying the FirstName field. Why does DO load the LastName and Age properties? Is it under the impression that I would mark them as lazy if I don't want them loaded... even if my query is explicitly stating the fields to be loaded through the projection? Is there a performance hit if I mark every field as lazy? Since I only want prefetched and projected fields to be loaded in any query? |
|
Ara, As DataObjects.Net tries to minimize the number of round trips to database, it loads all fields that are not marked as "Lazy" at Entity materialization. This is much more "cheaper" from the performance point of view than fetching a single field for every Entity in separate queries. Using "Lazy" fields does make sense when working with blobs or texts of huge size, especially keeping in mind the fact that physically they are located not inside the database row, but in a separate blob storage. |
