J'utilise WCF REST Preview 2 pour tester certains services REST. .? Le paquet a une extension IEnumerable comme ToDictionary (Func (TSource, TKey) keySelctor Je ne sais pas comment définir une fonction lambda pour revenir keySelectorExtension de WCF REST à Iounumerable Lambda Func <TSource, TKey> keySelector
Voici un exemple:
var items = from x in entity.Instances // a customized Entity class with list instances of MyClass
select new { x.Name, x};
Dictionary<string, MyClass> dic = items.ToDictionary<string, MyClass>(
(x, y) => ... // what should be here. I tried x.Name, x all not working
Je ne sais pas ce qui devrait ? être le lambda Func doit être retourner un KeySelector
Merci. Ça marche. –