User1559292362 posted
Hi djary,
Error below
occurs In the running time:
You couldn't use these conversion method in a LINQ to Entities statement, they cannot be translated to SQL, you need to do the conversions in memory. like this:
List<PostToXml> sampleposts = (from p in db.Posts
select p).AsEnumerable().Select(x => new PostToXml()
{
description = p.PostContent.Substring(0, 150),
link = "http://" + Request.Url.Host + "/Posts/SinglePost/" +p.PostID+"/"+Seo.GenerateSlug(p.PostTitle) ,
pubDate = p.PostDate,
title = p.PostTitle
}).ToList();
Best regards,
Cole Wu