most of the APIs remain the same however notable changes have been made #16
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.
most of the APIs remain the same however notable changes have been made:
no longer using raw Dictionary<string, string> but either MetadataCollection or OptionCollection; MetadataCollection contains strict validation on keys - this will help prevent invalid metadata key name issues where the user inputs an invalid metadata key and is accepted but is changed to fit the tus protocol.
no longer using raw actions for events; defined fully typed delegates for both upload progress and completition; those events contain two parameters now: 1st is source, 2nd is event context with the type of an interface - main issue here is that because ITusClient is now a transitive instance the instance should be provided as a source of the event.
TusBuild::DefaultTusClientBuild returns a DefaultTusBuilder. The only notable change here is that the configure functions contain two parameters: TusClientOptions and IHttpClientBuilder. Both TusBuild::DefaultTusClientBuild and the IServiceCollection extension provide access to the IHttpClientBuilders used, however only DefaultTusBuilder has the Build function. Both methods available (standalone call to Build or dependency injection) provide a transient ITusClient. Build can be called multiple times resulting in different ITusClient instances. - this allowed me to rewrite the TusBuild class to use what should easily be used by dotnet Dependency Injection architecture. Since most of the projects created with dotnet nowadays rely on its dependency injection for running, ITusClient should be injected in the already existing context and not create its own context. There are cases where one might want an isolated ITusClient and they can do that by using the TusBuild::DefaultTusClientBuild to create an isolated instance and maybe inject it in the main DI using a factory implementation.
I formatted all the text files and removed unused using statements as well as added more comments to functions/parameters.