It's common that records are trivial in that they only have an id, for example when they are just used to represent the end of a n-n relationship. This can result in this kind of entirely unnecessary database query when the Record lazy property is accessed for the first time:
SELECT slideshowp0_.Id AS Id880
FROM SlideShowSlideShowPartRecord slideshowp0
WHERE slideshowp0_.Id = @p0
Another example from a well-known module:
SELECT termspartr0_.Id as Id660 FROM Contrib_TaxonomiesTermsPartRecord termspartr0 WHERE termspartr0_.Id=@p0
We could probably detect that case or provide an attribute telling the framework it's unnecessary to ever query that record by id.
@bleroy created: https://orchard.codeplex.com/workitem/19356
It's common that records are trivial in that they only have an id, for example when they are just used to represent the end of a n-n relationship. This can result in this kind of entirely unnecessary database query when the Record lazy property is accessed for the first time:
SELECT slideshowp0_.Id AS Id880 FROM SlideShowSlideShowPartRecord slideshowp0 WHERE slideshowp0_.Id = @p0
Another example from a well-known module:
SELECT termspartr0_.Id as Id660 FROM Contrib_TaxonomiesTermsPartRecord termspartr0 WHERE termspartr0_.Id=@p0
We could probably detect that case or provide an attribute telling the framework it's unnecessary to ever query that record by id.