无法将类型“System.Collections.Generic.IEnumerable”隐式转换为“System.Collections.Generic.List

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();

你可能感兴趣的:(Collections)