NPoco icon indicating copy to clipboard operation
NPoco copied to clipboard

Thoughts on using newer language features of C#7.3 (or even 8)?

Open bryanboettcher opened this issue 4 years ago • 2 comments

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.

bryanboettcher avatar Oct 19 '20 15:10 bryanboettcher

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.

schotime avatar Oct 20 '20 13:10 schotime

Why not set to the newest instead of pointing in concrete version?

dario-l avatar Nov 18 '20 11:11 dario-l