示例#1
0
 // Serialization and Deserialization function calling
 public void Save(string path, List <Person> _list)
 {
     try
     {
         SerializationJSON <PersonEntity> serializationJSON = new SerializationJSON <PersonEntity>();
         serializationJSON.ToSerialize(_list.ToEntityCollection(), path);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
示例#2
0
 public List <Person> ToDeserialzie(string path)
 {
     if (!File.Exists(path))
     {
         return(new List <Person>());
     }
     try
     {
         SerializationJSON <PersonEntity> serializationJSON = new SerializationJSON <PersonEntity>();
         return(serializationJSON.ToDeserialzie(path).ToObjectCollection());
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }