无法将类型“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();

posted @ 2013-12-06 11:29  跟着阿笨一起玩.NET  阅读(9060)  评论(1编辑  收藏  举报