c# - how do i write an extension method on ConcurrentDictionary -


i have concurrentdictionary object defined concurrentdictionary<int, dirtyflag><int, dirtyflag> dirty flag enum has dirty/clean values.

i trying write extension method dirty objects. objects has dirtyflag set dirty.

i tried using gives me error:

public static concurrentdictionary<int, dirtyflag> getdirtyroutes(this concurrentdictionary<int, dirtyflag> wholedictionary) {      return wholedictionary.selectmany(a => a.value == dirtyflag.dirty);  } 

this error message getting:

the type arguments method 'system.linq.enumerable.selectmany<tsource,tresult> (system.collections.generic.ienumerable<tsource>,  system.func<tsource,system.collections.generic.ienumerable<tresult>>)' cannot  inferred usage. try specifying type arguments explicitly. 

any help?

public static concurrentdictionary<int, dirtyflag> getdirtyroutes(this concurrentdictionary<int, dirtyflag> wholedictionary) {     return new concurrentdictionary<int, dirtyflag>(         wholedictionary.where(a => a.value == dirtyflag.dirty)     ); } 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -