Can you elaborate on these comments in the generated code?
/// <remarks>This property is added for conveniance, however it is recommeded to use the method 'GetSingleAccountStoreOwner()', because
/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the
/// same scope. The property is marked non-browsable to make it hidden in binded controls, f.e. datagrids.</remarks>
[Browsable(false)]
public virtual AccountEntity AccountStoreOwner
I added that comment to be sure design guideline pundits (not you, but the peope who believe FxCop is the one source for checking if you're doing a good job) would be happy as well . The reason is that MS' library guidelines say that properties should be inexpensive routines, if the property can take a long time (which is the case with fetching related objects), it should be transfered into a method. However, you can't bind to a method, you need a property, so that's why I also added the property . It's 'wrong' according to the guidelines, but necessary because databinding otherwise won't work , so that's basicly the explanation for that comment.
Ah, I understand perfectly. I was aware that accessing that property would cause a fetch, but never thought about how this conflicts with the guideline that properties be inexpensive. In this case, the guideline doesn't fit very well.
I thought maybe this usage was going to be phased out, and I really like it.