Kunc.RiotGames.Lol.DataDragon
0.13.0
Prefix Reserved
dotnet add package Kunc.RiotGames.Lol.DataDragon --version 0.13.0
NuGet\Install-Package Kunc.RiotGames.Lol.DataDragon -Version 0.13.0
<PackageReference Include="Kunc.RiotGames.Lol.DataDragon" Version="0.13.0" />
<PackageVersion Include="Kunc.RiotGames.Lol.DataDragon" Version="0.13.0" />
<PackageReference Include="Kunc.RiotGames.Lol.DataDragon" />
paket add Kunc.RiotGames.Lol.DataDragon --version 0.13.0
#r "nuget: Kunc.RiotGames.Lol.DataDragon, 0.13.0"
#addin nuget:?package=Kunc.RiotGames.Lol.DataDragon&version=0.13.0
#tool nuget:?package=Kunc.RiotGames.Lol.DataDragon&version=0.13.0
Kunc.RiotGames.Lol.DataDragon
Simple client for League of Legends DataDragon.
How to Use
using Kunc.RiotGames.Lol.DataDragon;
using Microsoft.Extensions.DependencyInjection;
var service = new ServiceCollection()
.AddLolDataDragon()
.BuildServiceProvider();
ILolDataDragon lolDataDragon = service.GetRequiredService<ILolDataDragon>();
// or
ILolDataDragon lolDataDragon = LolDataDragon.Create();
int count = 5;
var language = "en_US";
var versions = await lolDataDragon.GetVersionsAsync();
var lastVersion = versions[0]; // or "latest"
Dictionary<string, ChampionDto> champions = await lolDataDragon.GetChampionsAsync(lastVersion, language);
Console.WriteLine($"Top {count} champions with the largest attack range:");
foreach (var champion in champions.Values.OrderByDescending(c => c.Stats.AttackRange).Take(count))
{
Console.WriteLine($"{champion.Name} {champion.Stats.AttackRange}");
}
Features
Support for "latest"
version
automatically converts the string "latest"
to the latest version e.g.:"15.1.1"
Caching
The HybridCache
is used as the caching provider, so by default it is only cached in memory, if you want an out-of-process cache, register IDistributedCache service to ServiceCollection
.
// optionally adding some IDistributedCache .. for example Redis
Services.AddStackExchangeRedisCache(o =>
{
o.Configuration = "connection string";
});
Services.AddLolDataDragon>(c =>
{
c.DefaultCacheEntryOptions = new HybridCacheEntryOptions() { ... };
});
Other useful things
Customizing JSON deserialization
The library allows to access the JsonSerializerOptions
instance which is used for deserializing JSON into a class.
So if there is some problem with the deserialization (e.g.: the property is of type int
but Riot returns a number in decimal format: 5.0
),
you can change it with:
Services.AddLolDataDragon>(c =>
{
c.JsonSerializerOptions = new JsonSerializerOptions()
{
Converters = { new DoubleToIntConverter() }
};
});
Disclaimer
Kunc.RiotGames.Lol.DataDragon
isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Kunc.RiotGames.Core (>= 0.13.0)
- Microsoft.Extensions.Caching.Hybrid (>= 9.5.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.5)
- Microsoft.Extensions.Http (>= 9.0.5)
- Microsoft.Extensions.Http.Resilience (>= 9.4.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Options (>= 9.0.5)
-
net9.0
- Kunc.RiotGames.Core (>= 0.13.0)
- Microsoft.Extensions.Caching.Hybrid (>= 9.5.0)
- Microsoft.Extensions.DependencyInjection (>= 9.0.5)
- Microsoft.Extensions.Http (>= 9.0.5)
- Microsoft.Extensions.Http.Resilience (>= 9.4.0)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.5)
- Microsoft.Extensions.Options (>= 9.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.13.0 | 188 | 5/15/2025 |
0.12.0 | 126 | 4/18/2025 |
0.11.0 | 161 | 3/22/2025 |
0.10.0 | 148 | 3/11/2025 |
0.9.0 | 84 | 2/25/2025 |
0.8.0 | 80 | 2/20/2025 |
0.7.0 | 87 | 2/12/2025 |
0.6.0 | 74 | 1/22/2025 |
0.5.0 | 67 | 1/17/2025 |
0.4.0 | 79 | 11/29/2024 |
0.2.0 | 154 | 8/13/2024 |
0.1.4 | 117 | 6/28/2024 |
0.1.3 | 137 | 6/18/2024 |
0.1.2 | 110 | 6/2/2024 |
0.1.1 | 143 | 4/15/2024 |