-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BeginScope accepts any type of KeyValuePair and Dictionary #223
Conversation
AFAIK we could use the pattern matching with open generics (c# 7.1 - https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.1/generics-pattern-match.md). That would preform better I think update: not sure if that will work, we need to know It's a bit pity KeyValuePair isn't implementing a covariant interface |
Codecov Report
@@ Coverage Diff @@
## master #223 +/- ##
==========================================
+ Coverage 72.15% 72.32% +0.17%
==========================================
Files 6 6
Lines 316 365 +49
Branches 75 89 +14
==========================================
+ Hits 228 264 +36
- Misses 59 65 +6
- Partials 29 36 +7
Continue to review full report at Codecov.
|
Changed the logic into using cached expression-trees, then the performance should not be super horrible. |
@304NotModified Please make one more review, when you get the time. Now one can also inject a single KeyValuePair instead of a whole list. |
Thanks, I'm on holiday but will try to find some time these days |
merged! Thanks! |
Make BeginScope more user-friendly by accepting any type of KeyValuePair.
There is an overhead from lookup in ConcurrentDictionary and boxing, so maybe one should just write to the InternalLogger instead of doing reflection.