public void WriteCurrentVersion(CurrentVersion currentVersion) { using (StreamWriter file = File.CreateText(_databaseProjectPath + "\\Updates\\DBCurrentVersion.txt")) { JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(file, currentVersion); } }
public CurrentVersion GetVersion() { using (StreamReader file = File.OpenText(_databaseProjectPath+"\\Updates\\DBCurrentVersion.txt")) { JsonSerializer serializer = new JsonSerializer(); CurrentVersion currentVersion = (CurrentVersion) serializer.Deserialize(file, typeof (CurrentVersion)); return currentVersion; } }