📅  最后修改于: 2022-03-11 14:49:20.539000             🧑  作者: Mango
// model
public class orderviewmodel
{
public string OrderNumber { get; set; }
public int Count { get; set; }
}
// BL
public IList Read(string tmpC)
{
try
{
using (var entities = new UrEntities())
{
return entities.Masters.Where(w => w.ContainerNumber.Equals(tmpC)).GroupBy(g => g.OrderNumber)
.Select(s => new orderviewmodel { OrderNumber = s.Key, Count = s.ToList().Count, }).ToList();
}
}
catch (Exception)
{
throw;
}
}