Walaa wrote:
So actually you want to add entities to the collection even if they present in the collection, right?
Yes
Does the collection already has entities before the fetch, or you want to prevent the query from using Distinct?
The collection is empty before the fetch.
Would you please post the generated Query?
Method Exit: CreateSelectDQ
Method Enter: CreatePagingSelectDQ
Method Enter: CreateSelectDQ
Method Enter: CreateSelectDQ
Generated Sql query:
Query: SELECT [LAPA].[dbo].[Book].[ID] AS [Id], [LAPA].[dbo].[Book].[Title], [LAPA].[dbo].[Book].[Abstract], [LAPA].[dbo].[Book].[Extract], [LAPA].[dbo].[Book].[Summary], [LAPA].[dbo].[Book].[CoverArtFilename], [LAPA].[dbo].[Book].[CoverArtThumbnailFilename], [LAPA].[dbo].[Book].[ISBN10] AS [Isbn10], [LAPA].[dbo].[Book].[ISBN13] AS [Isbn13], [LAPA].[dbo].[Book].[NumberOfPages], [LAPA].[dbo].[Book].[PublicationDate], [LAPA].[dbo].[Book].[FormatID] AS [FormatId], [LAPA].[dbo].[Book].[Dimensions], [LAPA].[dbo].[Book].[Keywords], [LAPA].[dbo].[Book].[LapaComment], [LAPA].[dbo].[Book].[isActive] AS [IsActive], [LAPA].[dbo].[Book].[UploadedExtract], [LAPA].[dbo].[Book].[StockNumber] FROM (( [LAPA].[dbo].[Book] INNER JOIN [LAPA].[dbo].[Book_Awards] ON [LAPA].[dbo].[Book].[ID]=[LAPA].[dbo].[Book_Awards].[BookID]) INNER JOIN [LAPA].[dbo].[Award] ON [LAPA].[dbo].[Award].[ID]=[LAPA].[dbo].[Book_Awards].[AwardID]) WHERE ( ( [LAPA].[dbo].[Book].[isActive] = @IsActive1)) ORDER BY [LAPA].[dbo].[Award].[Name] ASC
Parameter: @IsActive1 : Boolean. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: True.
Method Exit: CreateSelectDQ
Method Exit: CreatePagingSelectDQ: no paging.
This appears to be right as it brings back multiple records (almost like a left join).
Which specific runtime library are you using?
2.6.9.116