c# - Consolidation of an ObservableCollection based on keys -


i'm starting out forgive me if don't use correct terminology. i'm trying consolidate observablecollection> looping through , comparing 1 key other keys in collection. if same should compare matching keys values. don't have enough rep post pic.

        private void combineudas(observablecollection<tuple<object, object>> udas)          {              foreach (var item in udas)              {                                }            }

you can so:

public void combineudas( observablecollection<tuple<object, object>> udas ) {     foreach ( var item in udas )         foreach ( var inneritem in udas.where( inneritem => inneritem != inneritem && item.item1 == inneritem.item1 ) )             console.writeline( "value same: {0}", item.item2 == inneritem.item2 ); } 
  • loop on each item
  • for each item search in collection items same “key”
  • check if “values” equals

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -