Yandex Metrica Botan client for .NET NETStandard 2.0
Install via NuGet:
PM> Install-Package BotanClient
or build the NuGet with Cake build:
./build.ps1 -target "BotanClient"Register client in your services and provide your yandex metrica token:
services.AddSingleton(_ => new BotanClient.BotanClient(botanToken));Inject client into your controller:
private readonly BotanClient.BotanClient botanClient; public UpdateController(BotanClient.BotanClient botanClient) { this.botanClient = botanClient; }Send data to Botan:
await botanClient.SendEvent(new BotanMessage { EventName = "MY_EVENT", RawData = new { message = message, someMetric = 1.0 }, Uid = "UserIdHere" });