Suppose I have a Dictionary<String, Tuple<T1,T2>> , and I want to determine if the dictionary value has a V1 value for my T1. How can I do this most elegantly?
Dictionary<String, Tuple<T1,T2>>
Linq?
Well, it comes to mind:
var exists = dict.Values.Any(t => t.Item1 == v1);
bool b = dictionary.Any(item => item.Value.Item1 == searchTerm);
Source: https://habr.com/ru/post/1400947/More articles:Do not drag window title outside browser in extjs - formsexplain to me bootstrap-alert.js? - jqueryHow to check that the [name & subItem text] element already exists in another View list? - containsGetting the value of other attributes to select a data source - jqueryDynamic list combining orderby - genericsOpen selected click of another element with javascript - javascriptSimple Datetime format in YYYYMMDD format - c #Assign a reviewer from different groups at different stages of the workflow in Plone - workflowInitialize empty arraylists in Spring configuration? - javaCannot enter array list as dependency - javaAll Articles