c# - Filter list using lambda expressions -


the below method returns system.type classes namespace have specified. however, don't want all, able retrieve type want. want type inmiregisterrepository. how filter below list this? please help.

public static list<type> typesinnamespace(assembly assembly, string namespace) {     return assembly             .gettypes()             .where(o => string.equals(o.namespace, namespace, stringcomparison.ordinal))             .tolist(); } 

var item =  assembly                .gettypes()                .firstordefault(o => string.equals(o.namespace,                                         "inmiregisterrepository",                                         stringcomparison.ordinal)); 

or if want access returned list then:

var yourlist = typesinnamespace(......  var item = yourlist.firstordefault(o => string.equals(o.namespace,                                             "inmiregisterrepository",                                             stringcomparison.ordinal)); 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -