Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Linq;
- namespace TestLinq
- {
- class Data
- {
- public static object GetUsers()
- {
- using (var db = new MappingDataContext("TestLinq.Properties.Settings.reifitonConnectionString"))
- {
- return (from u in db.Users
- select new
- {
- user = u.Name,
- password = u.Password
- }).SingleOrDefault();
- }
- }
- public static T Cast<T>(object obj, T type)
- {
- return (T)obj;
- }
- }
- }
Add Comment
Please, Sign In to add comment