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. two filters in List class find function

two filters in List class find function

Scheduled Pinned Locked Moved C#
question
7 Posts 4 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.
  • S Offline
    S Offline
    Sonia Gupta
    wrote on last edited by
    #1

    How can i use two filters in the following code person pp = obj.Find(delegate(person p) { return p.name == "abc"; }); because there should be one return statement in a single block. So how will i declare another filter to refine the record

    Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.

    P G J 3 Replies Last reply
    0
    • S Sonia Gupta

      How can i use two filters in the following code person pp = obj.Find(delegate(person p) { return p.name == "abc"; }); because there should be one return statement in a single block. So how will i declare another filter to refine the record

      Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Sonia - you asked this question below. Don't repost questions, continue threads instead as this is just plain rude.

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      1 Reply Last reply
      0
      • S Sonia Gupta

        How can i use two filters in the following code person pp = obj.Find(delegate(person p) { return p.name == "abc"; }); because there should be one return statement in a single block. So how will i declare another filter to refine the record

        Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #3

        You can write several statements and use logical operators to return the value according to your filter requirements. Logical Operators in C#[^]

        #region signature my articles #endregion

        1 Reply Last reply
        0
        • S Sonia Gupta

          How can i use two filters in the following code person pp = obj.Find(delegate(person p) { return p.name == "abc"; }); because there should be one return statement in a single block. So how will i declare another filter to refine the record

          Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          person pp = obj.Find(delegate(person p) { return p.name == "abc" && BUY_A_BLOODY_C#_BOOK_FOR_THE_HUNDREDTH_TIME; });

          P 1 Reply Last reply
          0
          • J J4amieC

            person pp = obj.Find(delegate(person p) { return p.name == "abc" && BUY_A_BLOODY_C#_BOOK_FOR_THE_HUNDREDTH_TIME; });

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Possibly a little too subtle. I still don't think she'll get it.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            J 1 Reply Last reply
            0
            • P Pete OHanlon

              Possibly a little too subtle. I still don't think she'll get it.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              J Offline
              J Offline
              J4amieC
              wrote on last edited by
              #6

              Yes, I agree. I still have a lot to learn to achieve your level of sarcasm and wit :D

              P 1 Reply Last reply
              0
              • J J4amieC

                Yes, I agree. I still have a lot to learn to achieve your level of sarcasm and wit :D

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                J4amieC wrote:

                Yes, I agree. I still have a lot to learn to achieve your level of sarcasm and wit

                Oh I don't know. That post made me laugh. I even showed it to people.

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                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