xml - Distinct from two fields in dictionary c# -


hi have code fill dictionary data xml file how looks like(doc1 xmldocument)

 dict = doc1.elements()                 .where(x => x.name.localname != "country")                  .groupby(x => x.name.localname, y => y == null ? "" : (string)y)                 .todictionary(x => x.key,                     y => y.key == "openeddate" ?                         datetime.parseexact(y.firstordefault(), "yyyy-mm-dd", null).tostring("dd-mm-yyyy") :                         y.firstordefault()); 

i wanna ask, possible, in part , add 2 fields: country, , lets 1 oldname hope clear. wanna achieve exclude 2 fields (country , oldname) filling dict

to more clear , wanna change

.where(x => x.name.localname != "country")  

to

.where(x => x.name.localname != "country", x => x.name.localname != "oldname")  or  .where(x => x.name.localname != "country" && x.name.localname != "oldname" 

.where( (x.name.localname != "country") && (x.name.localname != "oldname") ) 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -