Skip to content

Instantly share code, notes, and snippets.

@patkleef
Created March 19, 2017 18:42
Show Gist options
  • Select an option

  • Save patkleef/f686ae57a88a0141778cff6116bc715c to your computer and use it in GitHub Desktop.

Select an option

Save patkleef/f686ae57a88a0141778cff6116bc715c to your computer and use it in GitHub Desktop.
Application Insights Blog - ApplicationInsightsDataService.cs
public class DataService
{
private readonly TelemetryClient _telemetryClient;
private readonly IDictionary<string, int> _dic;
public DataService()
{
_telemetryClient = new TelemetryClient();
_dic = new Dictionary<string, int>();
_dic.Add("house", 0);
_dic.Add("carr", 1);
_dic.Add("work", 2);
}
public int GetKeyByCategory(string category)
{
return _dic[category];
}
public void Save(int key, RegisterModel model)
{
_telemetryClient.TrackEvent("Registered event");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment