I hereby claim:
- I am benjaminabt on github.
- I am benjaminabt (https://keybase.io/benjaminabt) on keybase.
- I have a public key ASCApkKXr5BbmOMdy5NbZwHzb_kcd3X_m_X-Nro9gtyCDgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using MediatR; | |
using Microsoft.ApplicationInsights; | |
using Microsoft.ApplicationInsights.DataContracts; | |
using Microsoft.ApplicationInsights.Extensibility; | |
namespace BenjaminAbt.ApplicationInsights.MediatR | |
{ |
// C# 5 | |
public void MyMethod(string name) | |
{ | |
if (name == null) throw new ArgumentNullException("name", "name cannot be null."); | |
} | |
// C# 6 - nameof() to avoid magic strings | |
public void MyMethod(string name) | |
{ | |
if (name == null) throw new ArgumentNullException(nameof(name), $"{nameof(name)} cannot be null."); |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using BenchmarkDotNet.Attributes; | |
using Microsoft.Extensions.ObjectPool; | |
namespace Benchmarks; | |
[MemoryDiagnoser] | |
public class Benchmark |
public class MicrosoftDefenderBearerTokenClientProvider | |
{ | |
private const string _authority = "https://login.microsoftonline.com"; | |
private const string _audience = "https://api.securitycenter.microsoft.com"; | |
private static string[] s_scopes = new[] { $"{_audience}/.default" }; | |
public async Task<AuthenticationResult> GetToken | |
(string tenantId, string clientId, string secret) | |
{ |