Created
August 31, 2010 21:48
-
-
Save developerdame/559814 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class WebserviceWrapper : IWebserviceWrapper | |
{ | |
public static Dictionary<string, string> States; | |
public readonly object _locker = new object(); | |
public string GetStateName(string statecode) | |
{ | |
lock(_locker) | |
{ | |
if(States.HasKey(statecode)) | |
return state.value; | |
else | |
States[statecode] = LookupStateName(statecode); | |
} | |
} | |
Public string LookupStateName(string statecode) | |
{ | |
var service = new StateLookupWebService(); | |
return service.LookupStateName(statecode); | |
} | |
} | |
public interface IWrapWebservice | |
{ | |
string GetStateName(string statecode) | |
string LookupStateName(string statecode) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment