diff --git a/Scrummer/Code/BusinessLogic/Persistence.cs b/Scrummer/Code/BusinessLogic/Persistence.cs index 32d8137..31c356f 100644 --- a/Scrummer/Code/BusinessLogic/Persistence.cs +++ b/Scrummer/Code/BusinessLogic/Persistence.cs @@ -23,11 +23,26 @@ namespace Scrummer.Code.BusinessLogic #region public methods public static List LoadList(string file) + { + return LoadList(file, null); + } + + public static List LoadList(string file, List types) { List listResult = new List(); JSONParser parser = new JSONParser(); - parser.KnownTypes.Add(typeof(T)); - + Type typeResult = typeof(T); + if (typeResult.IsInterface == false) + { + parser.KnownTypes.Add(typeof(T)); + } + if (types != null) + { + foreach (Type type in types) + { + parser.KnownTypes.Add(type); + } + } string filePath = GetLocalPath(file); if (File.Exists(filePath) == false) { return listResult; }