As you would expect Microsoft is trying to make your code as clean and need as possible. This is an example of a search query. The key element of this query is select new {Title = m.Name}
. It allows you to map a your model to a new type without having to declear a custom class.
1 2 3 4 5 6 7 8 |
[HttpGet] public object ByName(string Name) { var query = from m in db.Table where m.Name.Contains(Name) select new {Title = m.Name}; return query.ToList(); } |