maxmind / GeoIP2-dotnet

MaxMind GeoIP2 .NET API
https://www.nuget.org/packages/MaxMind.GeoIP2
Apache License 2.0
350 stars 78 forks source link

Separate local database and Web API in different DLLs #16

Closed Mailaender closed 4 years ago

Mailaender commented 9 years ago

We are using your cool GeoLite2 databases in our Open Source RTS game engine recreation project @OpenRA since version 1 of your .NET API:

Thanks for that already!

We now depend on Newtonsoft.Json.dll and RestSharp.dll although we don't use any JSON or REST anywhere in the game. It is just a hard dependency of your GeoIP2 library. Therefore I suggest to separate the local database parsing and the Web API into separate DLLs of the same project so we and others can avoid unnecessary dependencies.

oschwald commented 9 years ago

Thanks for the suggestion. The web service and database use the same model classes, which is why they are all bundled together. We could potentially break it into three DLLs with one containing the shared code that both the web service and database reader depend on, but that wouldn't really reduce the dependencies.

A better solution might be to remove RestSharp entirely. I think the standard C# HttpClient class would likely be sufficient when used with Json.NET.

Mailaender commented 9 years ago

This issue is still open.

YuvalItzchakov commented 9 years ago

Has there been any decision on this one? I think removing both dependencies (RestSharp and Json.NET) would be awesome and would make it even easier to use the API.

oschwald commented 9 years ago

The Json.NET dependency will not be going away in the foreseeable future. It is used by the database reader. RestSharp should be relatively easy to replace, although we will have to change how we do the mocking for the unit tests.

oschwald commented 4 years ago

I am going to close this issue as we no longer use RestSharp and the plan is to replace Json.NET with System.Text.Json once version 5 is available.