Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var query = from p in db.Table
- select p;
- Dictionary<string, string> dic = new Dictionary<string, string>();
- foreach (var p in query)
- {
- dic.Add(sub.Key, sub.Value);
- }
- var dic = (from p in db.Table
- select new {p.Key, p.Value })
- .ToDictionary<string, string>(p => p.Key);
- var dic = db
- .Table
- .Select(p => new { p.Key, p.Value })
- .AsEnumerable()
- .ToDictionary(k=> k.Key, v => v.Value);
- var dictionary = db
- .Table
- .Select(p => new { p.Key, p.Value })
- .AsEnumerable()
- .ToDictionary(kvp => kvp.Key, kvp => kvp.Value)
- ;
- var dic = (from p in db.Table
- select new {p.Key, p.Value })
- .ToDictionary<string, string>(p => p.Key, p=> p.Value);
- var dic = db
- .Table
- .Select(p => new { p.Key, p.Value })
- .AsEnumerable()
- .ToDictionary(k=> k.Key, v => v.Value);
Add Comment
Please, Sign In to add comment