dbelmont / ExpressionBuilder

A library that provides a simple way to create lambda expressions to filter lists and database queries.
Apache License 2.0
372 stars 105 forks source link

NETSTANDARD2_2 #45

Closed ppmll closed 5 years ago

ppmll commented 5 years ago

I am using dotnet 2.2 and was trying your library, I realized that your code is not completelly prepared for netstandard 2.2 but the change is not that hard.

What I did to make it work was:

  1. in Settings.cs changed the:

    if NETSTANDARD2_0

    to

    if (NETSTANDARD2_0 || NETSTANDARD2_1 || NETSTANDARD2_2)

  2. in the Contains and NotContains operation, changed private readonly MethodInfo stringContainsMethod = typeof(string).GetMethod("Contains"); to private readonly MethodInfo stringContainsMethod = typeof(string).GetMethod("Contains", new Type[] { typeof(string) });

After that, I ran all your test cases and all went fine in both versions of net standard.

Hope this helps someone in the future!

dbelmont commented 5 years ago

Hi @ppmll,

That's amazing! 😄🎉👏 Many thanks for that!

Would you mind creating a pull request with this fix? That would help lots of people.

And, once again, many thanks!

Cheers, David