Page 1 of 1

Cross join have problem

Posted: Fri 07 Dec 2018 12:50
by phucduong
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?

Thanks

Re: Cross join have problem

Posted: Mon 10 Dec 2018 17:11
by Shalex
You are using v9.6.646, aren't you?

Please send us a small test project with the corresponding DDL/DML script for reproducing.

Re: Cross join have problem

Posted: Fri 14 Dec 2018 09:36
by phucduong
Hi Shalex
Thanks for your answer

i used devart version 9.6.597 and we got problem with cross join
this is very critical bug.
Could you please check?
Thanks

Re: Cross join have problem

Posted: Mon 17 Dec 2018 14:02
by Shalex
Upgrade to v9.6.646.

If this doesn't help, please send us a small test project with the corresponding DDL/DML script for reproducing.