-
-
Save peted70/4a9e61209e2a3bd8d567f8460fb9a76d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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