Henris blogg

 
« Back to blog

delegate find

ModulSamling m = modulsamling.Find(delegate(ModulSamling ms) { return ms.ID== item.Tag; });

Instead of:

ModulSamling m=FindModul(modulsamling, item.Tag);

privat ModulSamling FindModul(List<ModulSamling list, string tag)

{

      foreach(ModulSamling m in list)

      {

            if(m.ID==tag)

                  return m;

      }

      return null;

}

Comments (0)

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    Connect    twitter