Linq

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    Linq

    Hello,

    I have the following Linq query:

    PostPaper paper = (from p in database.Posts
    where p.PostID == id
    select new PostPaper {
    Post =
    p,
    Tags = (from pt in database.PostsT ags
    join t in database.Tags on pt.TagID
    equals t.TagID
    where pt.PostID == id
    orderby t.Name
    select t.Name) as tb,
    ViewTags = tb.ToArray()
    }).SingleOrDefa ult();

    The following is not working:
    select t.Name) as tb,
    ViewTags = tb.ToArray()

    Basically, I need to define ViewTags as an array by converting the
    list Tags.

    Thanks,
    Miguel
Working...