Vonage / vonage-dotnet-sdk

Vonage REST API client for .NET, written in C#. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
https://developer.vonage.com/
Apache License 2.0
107 stars 82 forks source link

Consider dropping usage of DI, logging and configuration #93

Closed janpieterz closed 5 years ago

janpieterz commented 6 years ago

It'd be great to be able to drop the usage of DI, logging and configuration dependencies.

Right now I'm hitting #72, and looking at that thread it looks like you'd be open for changing this.

For logging what is used often is LibLog (https://github.com/damianh/LibLog). For configuration, just allowing an easy way to set things up would allow removal of the dependencies too.

It might make this easier to maintain and support too, as the library would become more stripped down, just focusing on accepting a configuration object and executing the requests correctly.

If you'd be interested in this let me know, I'll happily do the work as it'd mean we can use this library instead of our own custom implementation.

smithrobs commented 6 years ago

We are in agreement in spirit and (mostly) in practice! v3.0 greatly removed the configuration aspect. As you mentioned, DI is only used for logging. Logging is done the way it is because that was the decision made at the time (see #9). This was okay until the MS DI breaking change complicated matters.

LibLog does look interesting; thanks for pointing that out to me. Give us 24 hours or so to think this over. @RabebOthmani any thoughts?

smithrobs commented 6 years ago

WIP branch here. Looking good; targeting for v3.1.

pbelo commented 5 years ago

I'm using Nexmo Client 3.2.2 and still getting #72 : "System.TypeInitializationException: The type initializer for 'Nexmo.Api.Configuration' threw an exception. ---> System.MissingMethodException: Method not found: 'System.Collections.Generic.Dictionary`2<System.String,System.Object> Microsoft.Extensions.Configuration.IConfigurationBuilder.get_Properties()'." How can I work around this issue?

RabebOthmani commented 5 years ago

Hi @pbelo , Could you please provide more details about your code and environment? Thanks

judy2k commented 5 years ago

@pbelo Please could you raise a new issue for this and give as much detail as you can.

I'm closing this issue because the original request has been implemented over the last few releases.