无法将类型“System.Collections.Generic.IEnumerable<EmailSystem.Model.TemplateInfo>”隐式转换为“System.Collections.Generic.List<EmailSystem.Model.TemplateInf
List<Model.Template> templateList = templateBLL.RecommendTemplateByOrder(modelEbay);
List<Model.TemplateInfo> recommandlist = templateList.Select(m => new Model.TemplateInfo
{
AccountId = m.AccountID,
LanguageId = m.Language.LanguageID,
LanguageName = m.Language.LanguageName,
TemplateId = m.TemplateID,
TemplateName = m.TemplateName
});
解决办法:
List<Model.TemplateInfo> recommandlist = templateList.Select(m => new Model.TemplateInfo
{
AccountId = m.AccountID,
LanguageId = m.Language.LanguageID,
LanguageName = m.Language.LanguageName,
TemplateId = m.TemplateID,
TemplateName = m.TemplateName
}).ToList();
无法将类型“System.Collections.Generic.IEnumerable<EmailSystem.Model.TemplateInfo>”隐式转换为“System.Collections.Generic.List<EmailSystem.Model.TemplateInf的更多相关文章
- NHibernate无法将类型“System.Collections.Generic.IList<T>”隐式转换为“System.Collections.Generic.IList<IT>
API有一个需要实现的抽象方法: public IList<IPermission> GetPermissions(); 需要注意的是IList<IPermission>这个泛 ...
- 无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“System.Collections.Generic.List<Ecology.Model.EnergyFlowGraph>”
无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“Sy ...
- using 语句中使用的类型必须可隐式转换为“System.IDisposable
在使用 EF 出现 using 语句中使用的类型必须可隐式转换为“System.IDisposable 今天写在这里分享给大家 出现这样的问题,是因为没有引用 EntityFramework 这个程 ...
- using 语句中使用的类型必须可隐式转换为“System.IDisposable”
在entity framework 中错误 using 语句中使用的类型必须可隐式转换为“System.IDisposable” 的错误. 原因是: 没有引用 EntityFramework 这个程序 ...
- 【.NET】using 语句中使用的类型必须可隐式转换为"System.IDisposable"
#问题: 在使用EF开发中,出现如下错误:“using 语句中使用的类型必须可隐式转换为“System.IDisposable” #原因: 项目中没有引用 EntityFramework 这个程序集: ...
- 报错:无法将类型"System.Data.EntityState"隐式转换为"System.Data.Entity.EntityState"
报错:无法将类型"System.Data.EntityState"隐式转换为"System.Data.Entity.EntityState". 出错语句停留 ...
- 错误 128 无法将类型“string”隐式转换为“System.Windows.Forms.DataGridViewTextBoxColumn”
原因是DataGridView中列的Name属性值和DataPropertyName属性值一样,比如Name="CardID",DataPropertyName="Car ...
- MVC 无法将类型“System.Collections.Generic.List<AnonymousType#1>”隐式转换为“System.Collections.Generic.IList<Mvc3Modeltest.Models.Movie>”。存在一个显式转换(是否缺少强制转换?))
1.问题: 2.解决方案:强制指定类型. 解决之.
- 使用EF6.0出现:CS0029 无法将类型“System.Data.Entity.Core.Objects.ObjectContext”隐式转换为“System.Data.Objects.ObjectContext”错误
这是因为EF6.0重构了一些命名空间后,和VS原有的实体数据模型模板不一致了(ObjectContext context = ((IObjectContextAdapter)dataContext). ...
随机推荐
- windows 安装maven 环境
1.maven 下载地址: http://maven.apache.org/index.html 2.解压到目录并配置环境变量 M2_HOME D:\maven\maven path ...
- Mysql JDBC Url参数说明useUnicode=true&characterEncoding=UTF-8
MySQL的 JDBC URL 格式 for Connector/J 如下例: jdbc:mysql://[host][,failoverhost...][:port]/[database] » [ ...
- js输出单一字符字串
<!DOCTYPE HTML> <html> <body> <input type="text" id="str" & ...
- Mongo的导出工具mongoexport介绍
需求介绍:将mongodb中的数据以文件的方式导出:json或cvs格式 mongo 提供了mongoexport的工具,可以实现将库中的数据以json或cvs的格式输出到文件中.mongoexpor ...
- Keil 的辅助工具和部份高级技巧
在前面的几讲中我们介绍了工程的建立方法,常用的调试方法,除此之外,Keil 还提供 了一些辅助工具如外围接口.性能分析.变量来源分析.代码作用分析等,帮助我们了解程 的性能.查找程序中的隐藏错误,快速 ...
- Git创建一个自己的本地仓库
如果我们要把一个项目加入到Git的版本管理中,可以在项目所在的目录用git init命令建立一个空的本地仓库,然后再用git add命令把它们都加入到Git本地仓库的暂存区(stage or inde ...
- bzoj2734
非常巧妙地题目对于一个数x列出这样的矩阵x 2x 4x 8x ……3x 6x 12x 24x ………………………………不难方案数就是求取数不相邻的方案数考虑矩阵宽不超过logn,所以可以用状压dp解决 ...
- bzoj1071
朴素的做法显然是O(n3)的考虑优化,我们将约束条件变形为A*h+B*v<=A*minh+B*minv+c右边是一个定值,当右边确定了minh之后,随着minv的增大,原来满足条件的且v> ...
- 【转】Android编译系统详解(三)——编译流程详解
原文网址:http://www.cloudchou.com/android/post-276.html 本文原创作者:Cloud Chou. 欢迎转载,请注明出处和本文链接 1.概述 编译Androi ...
- 2015第44周五Java集群技术(转)
从http://blog.csdn.net/cdh1213/article/details/21443239上看到这篇文章,感觉很不错,找好久没找到中文出处,最早看是从http://www.these ...