-
Notifications
You must be signed in to change notification settings - Fork 2
Remove the Services class, just create the RestClientFactory instead #123
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
19ddfc0
nullable disable not needed here
twogood 268f6ee
Fix nullable for MediaType
twogood dcde177
Handle nullable attribute parameters
twogood 206952e
Merge remote-tracking branch 'origin/main' into nullable-attributes
twogood 07b2ae7
Remove the Services class, just create the RestClientFactory instead
twogood 73c8049
Merge branch 'main' into remove-services
twogood a932dee
Use interface instead of implementation as type for Instance
twogood d074484
Fix IParamConverterManager
twogood f418b4d
Unfortunately CreateTaskConverter must be allowed to return null
twogood e7c9e9d
Expression body
twogood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,10 +1,8 @@ | ||
| #nullable disable | ||
| using System; | ||
|
|
||
| namespace Activout.RestClient.Helpers | ||
| namespace Activout.RestClient.Helpers; | ||
|
|
||
| public interface ITaskConverterFactory | ||
| { | ||
| public interface ITaskConverterFactory | ||
| { | ||
| ITaskConverter CreateTaskConverter(Type actualReturnType); | ||
| } | ||
| ITaskConverter? CreateTaskConverter(Type actualReturnType); | ||
| } |
This file contains hidden or 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,13 +1,13 @@ | ||
| #nullable disable | ||
| using ImpromptuInterface; | ||
|
|
||
| namespace Activout.RestClient.Helpers.Implementation | ||
| namespace Activout.RestClient.Helpers.Implementation; | ||
|
|
||
| public class DuckTyping : IDuckTyping | ||
| { | ||
| public class DuckTyping : IDuckTyping | ||
| public static IDuckTyping Instance { get; } = new DuckTyping(); | ||
|
|
||
| public TInterface DuckType<TInterface>(object originalDynamic) where TInterface : class | ||
| { | ||
| public TInterface DuckType<TInterface>(object originalDynamic) where TInterface : class | ||
| { | ||
| return originalDynamic.ActLike<TInterface>(); | ||
| } | ||
| return originalDynamic.ActLike<TInterface>(); | ||
| } | ||
| } |
10 changes: 6 additions & 4 deletions
10
Activout.RestClient/Helpers/Implementation/TaskConverter3Factory.cs
This file contains hidden or 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,13 +1,15 @@ | ||
| #nullable disable | ||
| using System; | ||
|
|
||
| namespace Activout.RestClient.Helpers.Implementation; | ||
|
|
||
| public class TaskConverter3Factory : ITaskConverterFactory | ||
| { | ||
| public ITaskConverter CreateTaskConverter(Type actualReturnType) | ||
| public static ITaskConverterFactory Instance { get; } = new TaskConverter3Factory(); | ||
|
|
||
| public ITaskConverter? CreateTaskConverter(Type actualReturnType) | ||
| { | ||
| return actualReturnType == typeof(void) ? null : | ||
| (ITaskConverter) Activator.CreateInstance(typeof(TaskConverter3<>).MakeGenericType(actualReturnType)); | ||
| return actualReturnType == typeof(void) | ||
| ? null | ||
| : (ITaskConverter?)Activator.CreateInstance(typeof(TaskConverter3<>).MakeGenericType(actualReturnType)); | ||
| } | ||
| } | ||
This file contains hidden or 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 was deleted.
Oops, something went wrong.
10 changes: 4 additions & 6 deletions
10
Activout.RestClient/ParamConverter/IParamConverterManager.cs
This file contains hidden or 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,11 +1,9 @@ | ||
| #nullable disable | ||
| using System; | ||
| using System.Reflection; | ||
|
|
||
| namespace Activout.RestClient.ParamConverter | ||
| namespace Activout.RestClient.ParamConverter; | ||
|
|
||
| public interface IParamConverterManager | ||
| { | ||
| public interface IParamConverterManager | ||
| { | ||
| IParamConverter GetConverter(Type type, ParameterInfo parameterInfo); | ||
| } | ||
| IParamConverter? GetConverter(Type type, ParameterInfo parameterInfo); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.