Doubt of licking on a guy

Asked

Viewed 70 times

-2

How do I make a lambda to bring only records that contain the word Transfer? For example, in my example, there are 19 records, but 3 are not Transfers, so it should come 16. Below my code and my lambda wrong.

OfferV2[] traslado = ((OfferV2[])SessaoUtil.Recuperar("MontaTraslado"));

                traslado = traslado.Where(x => x.).Contains("Traslado");
  • In which property of the Offerv2 object do you expect that word to appear?

  • 2

    Your example doesn’t even compile.

  • Do not compile because it is exactly as I said, my lambda is wrong. The Product Property

  • If I do so: transfer = transfer. Where(x => x.Productname). Contains("Transfer"); gives error in line x.Productname, saying is not possible

  • You could put the code in the Offerv2 class?

1 answer

4


It should be something like:

var traslado = ((OfferV2[])SessaoUtil.Recuperar("MontaTraslado"))
    .Where(x => x.ProductName.Contains("Traslado"))
    .ToArray();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.