I have something like this:
var model = forumsDb.Categories
.Select(c => new {c, c.Threads.Count})
.ToList()
My Category object looks like this (pseudocode):
public class Category
{
public int id {get;set;}
public ICollection<Thread> Threads { get; set; }
/***some properties***/
[NotMapped]
public int ThreadCount {get;set;}
}
Now, in my model object, i have two items: model.c and model.Count. How can i map model.Count into model.c.ThreadCount?
Define a strong type: