-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
this is my Class and code to
public enum StatusType
{
Waiting = 0,
Reading = 1,
Printing = 2
}
public class DistributeListDetail
{
public int Id {get;set;}
public string AddressCode {get;set;}
public StatusType Status {get;set;}
}now i have a Query like this
var result = Context.DistributeListDetails.Join().Where()
.GroupBy(x=> new { Path = x.AddressCode.SubString(0,4) })
.Select (x=> new {
AddressCodeGrouped = x.Key.Path,
DistributedCustomerCount = x.Count(),
WaitingCount = x.Count(c => c.Status == StatusType.Waiting),
ReadCount = x.Count(c => c.Status == StatusType.Reading ),
}).ToListAsync();the DistributedCustomerCount , WaitingCount , ReadCount is always Equals . maybe the
Conditionals at Count method not Translating.
EF Core version: 3.0
Database provider: (Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (.NET Core 3.0)
Operating system: Windows 10
IDE: (Visual Studio 2019 16.3)
bbrandt, philip-reed, GSPP and tvardero