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的更多相关文章

  1. NHibernate无法将类型“System.Collections.Generic.IList<T>”隐式转换为“System.Collections.Generic.IList<IT>

    API有一个需要实现的抽象方法: public IList<IPermission> GetPermissions(); 需要注意的是IList<IPermission>这个泛 ...

  2. 无法将类型“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 ...

  3. using 语句中使用的类型必须可隐式转换为“System.IDisposable

    在使用 EF 出现 using 语句中使用的类型必须可隐式转换为“System.IDisposable 今天写在这里分享给大家 出现这样的问题,是因为没有引用  EntityFramework 这个程 ...

  4. using 语句中使用的类型必须可隐式转换为“System.IDisposable”

    在entity framework 中错误 using 语句中使用的类型必须可隐式转换为“System.IDisposable” 的错误. 原因是: 没有引用 EntityFramework 这个程序 ...

  5. 【.NET】using 语句中使用的类型必须可隐式转换为"System.IDisposable"

    #问题: 在使用EF开发中,出现如下错误:“using 语句中使用的类型必须可隐式转换为“System.IDisposable” #原因: 项目中没有引用 EntityFramework 这个程序集: ...

  6. 报错:无法将类型"System.Data.EntityState"隐式转换为"System.Data.Entity.EntityState"

    报错:无法将类型"System.Data.EntityState"隐式转换为"System.Data.Entity.EntityState".   出错语句停留 ...

  7. 错误 128 无法将类型“string”隐式转换为“System.Windows.Forms.DataGridViewTextBoxColumn”

    原因是DataGridView中列的Name属性值和DataPropertyName属性值一样,比如Name="CardID",DataPropertyName="Car ...

  8. MVC 无法将类型“System.Collections.Generic.List<AnonymousType#1>”隐式转换为“System.Collections.Generic.IList<Mvc3Modeltest.Models.Movie>”。存在一个显式转换(是否缺少强制转换?))

    1.问题: 2.解决方案:强制指定类型. 解决之.

  9. 使用EF6.0出现:CS0029 无法将类型“System.Data.Entity.Core.Objects.ObjectContext”隐式转换为“System.Data.Objects.ObjectContext”错误

    这是因为EF6.0重构了一些命名空间后,和VS原有的实体数据模型模板不一致了(ObjectContext context = ((IObjectContextAdapter)dataContext). ...

随机推荐

  1. 插入标记 方法 insertAdjacentHTML

    html5新增的插入标记方法,insertAdjacentHTML() 可以接受2个参数 插入位置和要插入的 HTML 文本.第一个参数必须是下列值之一: "beforebegin" ...

  2. C# 获取路径中文件名、目录、扩展名等

    string path = "C:\\dir1\\dir2\\foo.txt"; string str = "GetFullPath:" + Path.GetF ...

  3. System.Reflection.Assembly.GetEntryAssembly()获取的为当前已加载的程序集

    今天在使用System.Reflection.Assembly.GetEntryAssembly()获取程序集时,发现获取的程序集不全.原来是因为C#的程序集为延迟加载,此方法只获取当前已加载的,未加 ...

  4. 《将博客搬至CSDN》 分类: 勉励自己 2014-09-05 14:29 43人阅读 评论(0) 收藏

    搬家啦,上博客园关注我哦http://www.cnblogs.com/AsuraRoute 版权声明:本文为博主原创文章,未经博主允许不得转载.

  5. scala 安装

    http://www.scala-lang.org/download/install.html http://zh.scala-tour.com/#/hello-wolrd scala指南 To ru ...

  6. Hadoop 学习笔记 (十) hadoop2.2.0 生产环境部署 HDFS HA Federation 含Yarn部署

    其他的配置跟HDFS-HA部署方式完全一样.但JournalNOde的配置不一样>hadoop-cluster1中的nn1和nn2和hadoop-cluster2中的nn3和nn4可以公用同样的 ...

  7. Contest20140705 testC DP

    testC 输入文件: testC.in 输出文件testC.out 时限1000ms 问题描述: ,⋯,an. ,a2,a3,⋯,an) ,⋯,alm. ,al2,al3,⋯,alm) 现要求G=g ...

  8. Hdu5510 Bazinga

    Description Ladies and gentlemen, please sit up straight. Don't tilt your head. I'm serious. For \(n ...

  9. Codeforces Round #204 (Div. 2): B

    很简单的一个题: 只需要将他们排一下序,然后判断一下就可以了! 代码: #include<cstdio> #include<algorithm> #define maxn 10 ...

  10. JBoss for luna

    Redhat官方手顺 貌似已经404了,搬运地址 我的Eclipse是Luna,每次进入Eclipse Market去装 http://marketplace.eclipse.org/content/ ...