Skip to content

Instantly share code, notes, and snippets.

@peted70
Created June 16, 2016 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peted70/4a9e61209e2a3bd8d567f8460fb9a76d to your computer and use it in GitHub Desktop.
Save peted70/4a9e61209e2a3bd8d567f8460fb9a76d to your computer and use it in GitHub Desktop.
public interface ICredentialStore
{
string GetToken(string id);
void AddToken(string id, string token);
}
public class CredentialStore : ICredentialStore
{
Dictionary<string, string> _idMap = new Dictionary<string, string>();
public void AddToken(string id, string token)
{
_idMap[id] = token;
}
public string GetToken(string id)
{
string val = null;
if (_idMap.TryGetValue(id, out val))
{
return val;
}
return null;
}
}
public class MyDependencies
{
public static ICredentialStore _store = new CredentialStore();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment