Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Can someone help me to find the equivalent Linq expressions?

Can someone help me to find the equivalent Linq expressions?

Scheduled Pinned Locked Moved C#
csharplinqdata-structureshelpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael Sync
    wrote on last edited by
    #1

    Hello All, Array.FindAll, Array.Find and List.RemoveAll() are not available in Silverlight. I'm looking for the equivalent Linq expressions of those methods. I'm also finding the equivalent one but it would be great if you guys can share if you already have something. thanks in advance..

    Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

    M 1 Reply Last reply
    0
    • M Michael Sync

      Hello All, Array.FindAll, Array.Find and List.RemoveAll() are not available in Silverlight. I'm looking for the equivalent Linq expressions of those methods. I'm also finding the equivalent one but it would be great if you guys can share if you already have something. thanks in advance..

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      I think it will work. public static class ArrayHelper { public static T Find(T[] array, Predicate match) { foreach (var o in array) { if (match(o)) { return o; } } return default(T); } public static T[] FindAll(T[] array, Predicate match) { List list = new List(); foreach (var o in array) { if (match(o)) { list.Add(o); } } return list.ToArray(); } }

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups