linq selecting into custom object
Posted
by user276640
on Stack Overflow
See other posts from Stack Overflow
or by user276640
Published on 2010-03-20T06:38:50Z
Indexed on
2010/03/20
6:41 UTC
Read the original article
Hit count: 327
what is wrong with such code
public List<SearchItem> Search(string find)
{
return (from i in _dataContext.News where i.Text.Contains(find) select new SearchItem { ControllerAction = "test", id = i.Id.ToString(), LinkText = "test" }).ToList();
}
public struct SearchItem
{
public string ControllerAction;
public string LinkText;
public string id;
}
© Stack Overflow or respective owner