S
shapper
Hello,
I am trying to translate a LINQ query in C# but I am having problems
in getting it right.
Could someone, please, help me? The online converters do not work with
LINQ.
C#
var counts = ctx.Customers.Select(x =>
new
{
Total = ctx.Customers.Count(),
Linked = ctx.Customers.Where(
cust => cust.CustomerCustomerDemos.Any()
|| cust.Orders.Any()).Count()
}).FirstOrDefault();
VB.NET
Dim counts = From x In ctx.Customers.Select( _
Function(x) _
Total = ctx.Customers.Count(), _
Linked = ctx.Customers.Where( _
Function(cust) _
cust.CustomerCustomerDemos.Any Or
cust.Orders.Any).Count).FirstOrDefault
What am I doing wrong?
It says Linked is not declared ...
Thanks,
Miguel
I am trying to translate a LINQ query in C# but I am having problems
in getting it right.
Could someone, please, help me? The online converters do not work with
LINQ.
C#
var counts = ctx.Customers.Select(x =>
new
{
Total = ctx.Customers.Count(),
Linked = ctx.Customers.Where(
cust => cust.CustomerCustomerDemos.Any()
|| cust.Orders.Any()).Count()
}).FirstOrDefault();
VB.NET
Dim counts = From x In ctx.Customers.Select( _
Function(x) _
Total = ctx.Customers.Count(), _
Linked = ctx.Customers.Where( _
Function(cust) _
cust.CustomerCustomerDemos.Any Or
cust.Orders.Any).Count).FirstOrDefault
What am I doing wrong?
It says Linked is not declared ...
Thanks,
Miguel