因为我是linq的新手你可以帮我转换下面的SQL查询到linq。
Select o.* from [Order] o Left Join TransactionsTable yo on o.Id = yo.OrderId
Where yo.OrderId is null and Convert(date,o.CreatedOnUtc) =
Convert(date,getutcdate()) and o.OrderStatusId = 1
你可以试试这个。
var q = from o in Orders
join yo in TransactionsTables on o.Id equals yo.OrderId into tt
from yo in tt.DefaultIfEmpty()
where !yo.OrderId.HasValue
&& o.CreatedOnUtc.Value.Date == DateTime.UtcNow.Date
&& o.OrderStatusId == 1
select o ;