linq to sql ,将var 类型转为 IList 类型
public void SOHSelecting(int startRowIndex, int maximumRows, string sortExpression, string location)
{
int totalCount = ;
IList<Logistics.LogisticsBinReference> getSOHList = new List<LogisticsBinReference>(); var list = View.SohLists.Where(c => c.SubInventory == location).GroupBy(x => x.BinLocation).Select(x => new {
BinLocation = x.First().BinLocation,
SOH = x.Sum(y => y.SOH)
}).ToList(); IList<LogisticsBinReference> list2 = new List<LogisticsBinReference>();
foreach (var item in list)
{
LogisticsBinReference l = new LogisticsBinReference();
l.BinLocation = item.BinLocation;
l.SOH = item.SOH;
list2.Add(l);
} getSOHList = list2.AsQueryable().SortingAndPaging(sortExpression, startRowIndex, maximumRows, out totalCount).ToList(); View.SOHTotalCount = totalCount;
View.BindSOHObjectContainerDataSource(getSOHList);
}
linq to sql ,将var 类型转为 IList 类型的更多相关文章
- MySQL中,把varchar类型转为date类型
如下表: 先使用str_to_date函数,将其varchar类型转为日期类型,然后从小到大排序 语法:select str_to_date(class_time,'%Y%m%d %H:%i:%s') ...
- .NET枚举类型转为List类型
如图所示这个竞卖状态,原先是在前端界面通过html代码写死的几个状态,现在需要改为动态加载.这个几个状态是定义的枚举类型. 1:定义一个枚举类型 /// <summary> /// ...
- 使用alibaba的json工具将String类型转为JSONArray类型
转化流程:先将输入流转为String类型,再使用alibaba的json转换工具,将字符串转化为json数组 SensorDevices sensorDevices = new SensorDevic ...
- js 字符串类型转为数组类型
以前从来没有想过这个转换,以为直接拼出来就可以了,今天同事问我这个问题,特记录如下. var test='["colkey", "col", "col ...
- c++中 string类型 转为 char []类型
将string类型转换为字符数组char [] char arr[50]; //数组大小根据s的大小确定 string s= "12slfjksldkfjlsfk"; int le ...
- django:将query-set类型转为json类型
import json data = json.dumps(list(my_table.objects.all().values())) return HttpResponse(data)
- java Int类型转为double 类型;string转double
int a=12; double b=(double)a; or double c=Double.valueOf((double)a); string a_s="12"; doub ...
- Linq to SQL Like Operator
As a response for customer's question, I decided to write about using Like Operator in Linq to SQL q ...
- 【C#】string格式的日期转为DateTime类型及时间格式化处理方法
日期格式:yyyyMMdd HH:mm:ss(注意此字符串的字母大小写很严格) yyyy:代表年份 MM: 代表月份 dd: 代表天 HH: 代表小时(24小时制) mm: 代表分钟 ss: 代表秒 ...
随机推荐
- 5种你未必知道的JavaScript和CSS交互的方法
随着浏览器不断的升级改进,CSS和JavaScript之间的界限越来越模糊.本来它们是负责着完全不同的功能,但最终,它们都属于网页前端技术,它们需要相互密切的合作.我们的网页中都有.js文件和.css ...
- 【mysql5.6】连接vs2010
参考这篇博客:http://www.tuicool.com/articles/mUZNne 配置:vs2010项目属性里面配置包含目录和库目录. 包含目录:C:\Program Files\MySQL ...
- 刘汝佳 算法竞赛-入门经典 第二部分 算法篇 第五章 1(String)
第一题:401 - Palindromes UVA : http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8 ...
- To Use Ubuntuubunt
1.rename PC; modify the /etc/hostname. 2.Use root account; 1.set the password for root account: sudo ...
- light oj 1068 - Investigation 数位DP
思路:典型的数位DP!!! dp[i][j][k]:第i位,对mod取余为j,数字和对mod取余为k. 注意:由于32位数字和小于95,所以当k>=95时,结果肯定为0. 这样数组就可以开小点, ...
- UVA 10574 - Counting Rectangles 计数
Given n points on the XY plane, count how many regular rectangles are formed. A rectangle is regular ...
- poj 3621(最优比率环)
题目链接:http://poj.org/problem?id=3621 思路:之前做过最小比率生成树,也是属于0/1整数划分问题,这次碰到这道最优比率环,很是熟悉,可惜精度没控制好,要不就是wa,要不 ...
- Java 网络编程(二)
以下例开始本文的内容: 例1,需求:上传图片. 客户端: 服务端点. 读取客户端已有的图片数据. 通过socket输出流将数据发给服务端. 读取服务端反馈信息. 关闭. class PicClient ...
- MongoDB (十一) MongoDB 排序文档
sort() 方法 要在 MongoDB 中的文档进行排序,需要使用sort()方法. sort() 方法接受一个文档,其中包含的字段列表连同他们的排序顺序.要指定排序顺序1和-1. 1用于升序排列, ...
- hdu2025查找最大元素
#include<iostream> #include<stdio.h> #include<math.h> #include<stdlib.h> #in ...