Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
871166c
First pass
SteveDunn Apr 17, 2022
3fe8714
Remove commented code
SteveDunn Apr 17, 2022
65ea989
Support IReadOnlySet. Refactor out method that determines most suitab…
SteveDunn Apr 18, 2022
c2d1038
Handles ISet after rebase. Still to do IReadOnlySet
SteveDunn Apr 19, 2022
2613c44
Add support back for `IReadOnlySet`
SteveDunn Apr 19, 2022
b377ac1
PR feedback - pre-allocate just one array instead of many allocations…
SteveDunn Apr 19, 2022
10e6238
All tests pass.
SteveDunn Apr 22, 2022
c8e7b60
Tidy
SteveDunn Apr 23, 2022
ef33f6f
Skips custom sets
SteveDunn Apr 23, 2022
accbc13
Strip out unused code
SteveDunn Apr 23, 2022
92afd9a
Tidy up and remove dead code.
SteveDunn Apr 23, 2022
3687886
Tidy up tests
SteveDunn Apr 23, 2022
3c65aa4
Tidy up comments
SteveDunn Apr 23, 2022
ee0b40b
Copy over @halter73's changes
SteveDunn May 5, 2022
6b6f6cd
Copy over @halter73's changes
SteveDunn May 5, 2022
6efcd54
Copy over @halter73's changes
SteveDunn May 5, 2022
3454939
Added restrictions and some tests for set keys being string/enum only
SteveDunn May 5, 2022
686192e
PR feedback re. preprocessor directive
SteveDunn May 30, 2022
b9a9f3a
Started on instantiated dictionary feedback
SteveDunn May 30, 2022
32609c8
First pass at cloning dictionary<,>
SteveDunn Jun 4, 2022
1310ebd
Can now bind (overwrite) to an existing concrete dictionary
SteveDunn Jun 4, 2022
da49d5b
Refactor out common code for binding to existing dictionary. Added te…
SteveDunn Jun 4, 2022
3f359f4
Comments and more tests
SteveDunn Jun 4, 2022
c015c01
Add explicit (separate) test for binding to non-instantiated IReadOnl…
SteveDunn Jun 4, 2022
93cf8c0
PR feedback - add tests
SteveDunn Jun 12, 2022
1667f86
PR feedback: introdcue variable for `typeIsADictionaryInterface'
SteveDunn Jun 13, 2022
ca1defe
PR feedback
SteveDunn Jun 13, 2022
72be954
Fix rebase issues
SteveDunn Jul 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PR feedback: introdcue variable for `typeIsADictionaryInterface'
  • Loading branch information
SteveDunn committed Jul 18, 2022
commit 1667f86e6f2e9ed13cca33e73bfac5f99ee5c5b8
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,13 @@ private static void BindInstance(
return;
}

bool typeIsADictionaryInterface = TypeIsADictionaryInterface(type);

// For other mutable interfaces like ICollection<> and ISet<>, we prefer copying values and setting them
// on a new instance of the interface over populating the existing instance implementing the interface.
// This has already been done, so there's not need to check again. For dictionaries, we fill the existing
// instance if there is one (which hasn't happened yet), and only create a new instance if necessary.
if (TypeIsADictionaryInterface(type))
if (typeIsADictionaryInterface)
{
if (!bindingPoint.IsReadOnly)
{
Expand All @@ -342,7 +344,7 @@ private static void BindInstance(
// on a new instance of the interface over populating the existing instance implementing the interface.
// This has already been done, so there's not need to check again. For dictionaries, we fill the existing
// instance if there is one (which hasn't happened yet), and only create a new instance if necessary.
if (TypeIsADictionaryInterface(type))
if (typeIsADictionaryInterface)
{
Type typeOfKey = type.GenericTypeArguments[0];
Type typeOfValue = type.GenericTypeArguments[1];
Expand Down