I find myself repeating bits of code like this over and over while using ADO.NET Entity Framework.
VB:
' Load the thing if not already loaded. '
If Not Something.Thing.IsLoaded Then
Something.Thing.Load()
End If
C#:
// Load the thing if not already loaded.
if (!Something.Thing.IsLoaded)
{
Something.Thing.Load();
}
Is this normal? Should I be using IsLoaded and Load so often? Or am I not using this correctly?