Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: Not able to get Deep Load working

$
0
0
Hi,

I am definitely having issues with Deep Loading - have spent days on this issue and really struggling to resolve.
The statement I am using is same as above:
  var artist = _artistService.Query(a => a.ArtistID == id).Include(al => al.ArtistLinks).Select().First();

Where I simply want to get all ArtistLinks associated the current artist.

Could I have setup EF incorrectly?
I have ensured:
  • Lazy Loading and ProxyCreation is disabled.
The SQL being created looks fine:

SELECT
[Project1].[ArtistID] AS [ArtistID], 
[Project1].[ArtistName] AS [ArtistName], 
[Project1].[ArtistNickname] AS [ArtistNickname], 
[Project1].[ArtistTitle] AS [ArtistTitle], 
[Project1].[ArtistDescription] AS [ArtistDescription], 
[Project1].[EnableSoundCloudDisplay] AS [EnableSoundCloudDisplay], 
[Project1].[SoundCloudUrl] AS [SoundCloudUrl], 
[Project1].[EnableYouTubeDisplay] AS [EnableYouTubeDisplay], 
[Project1].[YouTubeUrl] AS [YouTubeUrl], 
[Project1].[EnableFlickrDisplay] AS [EnableFlickrDisplay], 
[Project1].[FlickrSet] AS [FlickrSet], 
[Project1].[Notes] AS [Notes], 
[Project1].[IsFeatured] AS [IsFeatured], 
[Project1].[FeatureYouTubeUrl] AS [FeatureYouTubeUrl], 
[Project1].[IsActive] AS [IsActive], 
[Project1].[CreatedDate] AS [CreatedDate], 
[Project1].[CreatedBy] AS [CreatedBy], 
[Project1].[ModifiedDate] AS [ModifiedDate], 
[Project1].[ModifiedBy] AS [ModifiedBy], 
[Project1].[C1] AS [C1], 
[Project1].[ArtistLinkID] AS [ArtistLinkID], 
[Project1].[ArtistID1] AS [ArtistID1], 
[Project1].[LinkTitle] AS [LinkTitle], 
[Project1].[LinkUrl] AS [LinkUrl], 
[Project1].[CreatedDate1] AS [CreatedDate1], 
[Project1].[CreatedBy1] AS [CreatedBy1], 
[Project1].[ModifiedDate1] AS [ModifiedDate1], 
[Project1].[ModifiedBy1] AS [ModifiedBy1]
FROM ( SELECT 
    [Extent1].[ArtistID] AS [ArtistID], 
    [Extent1].[ArtistName] AS [ArtistName], 
    [Extent1].[ArtistNickname] AS [ArtistNickname], 
    [Extent1].[ArtistTitle] AS [ArtistTitle], 
    [Extent1].[ArtistDescription] AS [ArtistDescription], 
    [Extent1].[EnableSoundCloudDisplay] AS [EnableSoundCloudDisplay], 
    [Extent1].[SoundCloudUrl] AS [SoundCloudUrl], 
    [Extent1].[EnableYouTubeDisplay] AS [EnableYouTubeDisplay], 
    [Extent1].[YouTubeUrl] AS [YouTubeUrl], 
    [Extent1].[EnableFlickrDisplay] AS [EnableFlickrDisplay], 
    [Extent1].[FlickrSet] AS [FlickrSet], 
    [Extent1].[Notes] AS [Notes], 
    [Extent1].[IsFeatured] AS [IsFeatured], 
    [Extent1].[FeatureYouTubeUrl] AS [FeatureYouTubeUrl], 
    [Extent1].[IsActive] AS [IsActive], 
    [Extent1].[CreatedDate] AS [CreatedDate], 
    [Extent1].[CreatedBy] AS [CreatedBy], 
    [Extent1].[ModifiedDate] AS [ModifiedDate], 
    [Extent1].[ModifiedBy] AS [ModifiedBy], 
    [Extent2].[ArtistLinkID] AS [ArtistLinkID], 
    [Extent2].[ArtistID] AS [ArtistID1], 
    [Extent2].[LinkTitle] AS [LinkTitle], 
    [Extent2].[LinkUrl] AS [LinkUrl], 
    [Extent2].[CreatedDate] AS [CreatedDate1], 
    [Extent2].[CreatedBy] AS [CreatedBy1], 
    [Extent2].[ModifiedDate] AS [ModifiedDate1], 
    [Extent2].[ModifiedBy] AS [ModifiedBy1], 
    CASE WHEN ([Extent2].[ArtistLinkID] IS NULL) THEN CAST(NULL AS int) ELSE 1 END AS [C1]
    FROM  [dbo].[Artists] AS [Extent1]
    LEFT OUTER JOIN [dbo].[ArtistLinks] AS [Extent2] ON [Extent1].[ArtistID] = [Extent2].[ArtistID]
    WHERE ([Extent1].[ArtistID] <> @p__linq__0) AND ([Extent1].[IsFeatured] = 1)
)  AS [Project1]
ORDER BY [Project1].[IsFeatured] DESC, [Project1].[CreatedDate] DESC, [Project1].[ArtistID] ASC, [Project1].[C1] ASC

-- p__linq__0: '2' (Type = Int32, IsNullable = false)



Really at a loss as to why I cannot get the artist object to deep load the links.

Thanks for your time.

Regards,
Steve

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>