I want to get Entities by using same function.

```
 public static T getById<T>(int Id)
 {
        myDataContect db = new myDataContect();
        return (from u in db.GetTable<T> where u.Id == Id select u).FirstOrDefault();
 }

```

How to write valid function ? Any ideas ?