NPoco
NPoco copied to clipboard
Thoughts on using newer language features of C#7.3 (or even 8)?
This would not affect the targeting, just the minimum version of VS/dotnet required to build.
There are many features in the newer C# language which can simplify the code inside of NPoco. These would be things like formattable strings, most everything around nulls (coalesce, propagation), type-cast pattern matching, using declarations, etc.
For instance, all the "OnXXX" hooks would (IMO, anyway) look great bundled together as method-bodies.
I can create a PR with these changes if you'd be interested. It would be based on v5. There would be no functional or behavioral changes, just the reduction/simplification of code. It would potentially goop up any outstanding PRs with merges though.
Thats in the latest commit that I hadn't pushed. https://github.com/schotime/NPoco/blob/v5/src/NPoco/NPoco.csproj#L20
I'd rather not do these things until all v5 features/fixes are done, then i'd be happy to take a PR.
Why not set to the newest instead of pointing in concrete version?