public void WriteCurrentVersion(CurrentVersion currentVersion)
 {
     using (StreamWriter file = File.CreateText(_databaseProjectPath + "\\Updates\\DBCurrentVersion.txt"))
     {
         JsonSerializer serializer = new JsonSerializer();
         serializer.Serialize(file, currentVersion);
     }
 }
예제 #2
0
        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;
            }
        }