.NET
Use the client directly
Inject IIpGeoTraceClient into any controller or service and resolve whatever IP you supply. Nothing touches the request pipeline.
Where the IP comes from is entirely your call - a signup form, a webhook payload, a stored audit log. No UseIpGeoTrace call is needed for this path.
Resolve a single address#
ResolveAsync returns a result you check with IsSuccess before reading Value. Here it screens new signups for datacenter IPs and country mismatches.
csharp
public sealed class SignupScreening(IIpGeoTraceClient geo)
{
public async Task<bool> NeedsReviewAsync(string signupIp, string billingCountry, CancellationToken ct)
{
var result = await geo.ResolveAsync(signupIp, ct);
if (!result.IsSuccess)
return false;
var fromDatacenter = result.Value.Asn?.Type == "hosting";
var countryMismatch = result.Value.Country?.Code is { } code && code != billingCountry;
return fromDatacenter || countryMismatch;
}
}Resolve a batch#
ResolveBatchAsync enriches many addresses in one round trip - ideal for a page of audit records or login history.
csharp
var batch = await geo.ResolveBatchAsync(logins.Select(l => l.IpAddress), ct);
if (batch.IsSuccess)
foreach (var item in batch.Value.Results)
report.Add(item.Ip, item.Country?.Name, item.Asn?.Name);Full client reference
See the IPGeoTrace.Client package for the complete client documentation.