Created
April 10, 2013 16:25
-
-
Save adilakhter/5356163 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 override void Save<T>(T obj) | |
{ | |
string serailzedObj = SerializeHelper.Serialize(obj); | |
File.WriteAllText(_PersistenceMediaPath, serailzedObj); | |
} | |
public override T Get<T>() | |
{ | |
string stringContent = File.ReadAllText(_PersistenceMediaPath); | |
if (!String.IsNullOrEmpty(stringContent)) | |
return ((T)SerializeHelper.Deserialize(typeof(T), stringContent)); | |
return default(T); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment