-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#72 Pure.DI not compatible with .NET 9
- Loading branch information
1 parent
73e5912
commit 5c300c7
Showing
7 changed files
with
54 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace Pure.DI.Core.Models; | ||
|
||
internal readonly record struct ImplementationVariant(ImplementationVariantKind Kind, DpMethod Method); | ||
internal record ImplementationVariant(ImplementationVariantKind Kind, DpMethod Method); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#pragma warning disable CS8766 // Nullability of reference types in return type doesn't match implicitly implemented member (possibly because of nullability attributes). | ||
namespace Pure.DI.Core; | ||
|
||
internal class SafeEnumerator<T>(IEnumerator<T> source): IEnumerator<T> | ||
where T: class | ||
{ | ||
private T? _current; | ||
private bool _result; | ||
|
||
public T? Current | ||
{ | ||
get | ||
{ | ||
if (!_result) | ||
{ | ||
return _current; | ||
} | ||
|
||
_current = source.Current; | ||
return _current; | ||
} | ||
} | ||
|
||
object? IEnumerator.Current => Current; | ||
|
||
public bool MoveNext() | ||
{ | ||
_result = source.MoveNext(); | ||
return _result; | ||
} | ||
|
||
public void Reset() => source.Reset(); | ||
|
||
public void Dispose() => source.Dispose(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters