Cross join have problem

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 1
Joined: Fri 07 Dec 2018 12:34

Cross join have problem

Post by phucduong » Fri 07 Dec 2018 12:50

Hi Support team

i have problem when use cross join in linq
let say:

In database we have 1 record in Comments and the comments have 2 records (files) in Files reference to this comment
and i use this query
var query=
from c in WorkScope.All<Comments>().Where(x => x.Id == id)
join status in WorkScope.All<APStatus>() on dec.APStatusId equals status.Id
join file in WorkScope.All<Files>() on c.Id equals file.CommentId into files
select new
CommentId = c.Id
Name = c.Name,
Content = c.Content,
Files = files,
Status = status.Name
var result = query.ToList();
and the result return 2 records, both of them have the same CommentId, Name, Content, Status but the Files have follow value [file1], [file2]
The expect result have to return only 1 record with Files is [file1, file2]

Do you have any suggestion on this?


Post Reply