seraphx2 / ESI.NET

A C# wrapper for the Eve Online ESI API.
https://www.nuget.org/packages/ESI.NET/
MIT License
40 stars 23 forks source link

Added option to use class for setting config. #30

Closed mrurb closed 4 years ago

mrurb commented 4 years ago

Added option to use EsiConfig class for setting config, as IConfigurationSection is not always available, ex in Azure functions

OperatorOverload commented 4 years ago

FWIW, this was possible using the structure showing the README.. see below for the example, would this work for your use case?

IOptions<EsiConfig> config = Options.Create(new EsiConfig()
{
    EsiUrl = "https://esi.evetech.net/",
    DataSource = DataSource.Tranquility,
    ClientId = "**********",
    SecretKey = "**********",
    CallbackUrl = "",
    UserAgent = ""
});

EsiClient client = new EsiClient(config);
mrurb commented 4 years ago

No this would not work, as i do want dependency injection and in Azure functions you can't really give it full json settings nicely.