July 8, 2009 oslofeaturedcontent

Telerik Does LINQ to M”

Stephen Forte and Mehfuz (who, like Prince and Cher, needs no last name), have built LINQ to M”, which means that if you’ve got M” source code like this (shown in a C# string variable for loading convenience):

string MGraphCode =
@"{{Name=""Stephen Forte"", Age=37}, ... }";

and a C# type like this:

public class Person {
  public string Name { get; set; }
  public int Age { get; set; }
}

then you can load the M” source and run LINQ queries against it:

var persons =
QueryContext.Instance.Load<Person>(MGraphCode);
var result =
from person in persons
  where person.Age == 37 &&
person.Name == "Stephen Forte"
  orderby person.Name ascending
  select person;

Enjoy!