You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from a in Assignments
where a.AssignmentsRelayAssignment.Relay_Id == 2
&& a.AssignmentsRelayAssignment.Type == "Organizations"
select new Models.AssignmentGridItem
{
Id = a.Id,
DeliveryDate = a.DeliveryDate,
UndeliveryDate = a.UndeliveryDate,
WorksCount = a.WorksToAssignments.Count(),
};
generate SQL:
SELECT
[a].[Id],
[a].[DeliveryDate],
[a].[UndeliveryDate],
(
SELECT
Count(*)
FROM
[dbo].[Works] [c]
WHERE
[a].[Id] = [c].[Assignment_Id]
) as [c1]
FROM
[dbo].[Assignments] [a]
INNER JOIN [dbo].[AssignmentsRelay] [t1] ON [a].[Id] = [t1].[Id]
INNER JOIN [dbo].[Works] [t2] ON [a].[Id] = [t2].[Assignment_Id]
WHERE
[t1].[Relay_Id] = 2 AND [t1].[Type] = 'Organizations'
Join to Works table not need
The text was updated successfully, but these errors were encountered:
I've encountered a case when SingleOrDefault() (at line #38) throws `InvalidOperationException` due to finding more than one assembly item in the collection.
For LINQ query:
generate SQL:
Join to Works table not need
The text was updated successfully, but these errors were encountered: