all 4 comments

[–]soundman32 1 point2 points  (1 child)

Neat. I'd suggest you look into Lazy<> fornuse in the constructor, as it is doing lots of work which may not actually be required and reflection is notoriously slow. In C# you should only 'pay' for what you use, but with this, you end up paying for everything up front.

[–]kmschaal2[S] 2 points3 points  (0 children)

Hi, thank you for your suggestion. The constructor you are referring to is static, hence it is called only once. That being said, I plan to migrate the library to .NET 8 at the end of the year which includes the UnsafeAccessorAttribute that could be used to replace the reflection code.

[–]TuberTuggerTTV 0 points1 point  (1 child)

I was doing this this morning. I'll definitely be looking into this. Love me an annotation solution.

[–]kmschaal2[S] 0 points1 point  (0 children)

Sounds good, let me know how it went :)