我希望 datetime.now 返回英国格式的日期时间对象。它在我的本地计算机上执行此操作,但是当我将代码上传到服务器时,它以美国格式执行
我想在linq结果中添加一个项目.这是我的初步查询.
var groups = from gr in monitors.groupiddeviceids
where gr.device.customerID == customerID
group gr by gr.grouping.GroupName into g
select new { Group = g.Key, Devices = g.Count() };
Run Code Online (Sandbox Code Playgroud)
我想把它放到gridview数据源中,如下所示:
gvGroups.DataSource = groups.ToList();
Run Code Online (Sandbox Code Playgroud)
但事先我想再添加一行.该行为{string,int}格式.我要添加的行应为{"未分配",14}
如何将项目添加到匿名类型的linq列表中?