///<summary>Список последних версий</summary> public List <AppVersion> GetVersionFileSystem() { IList <AppVersion> versions = Src_meta.FindAll(); List <AppVersion> versionsSort = new List <AppVersion>(); string[] VersionsApps = (from v in versions select v.VersionName.ToString()).Distinct().ToArray(); versionsSort.AddRange(from string v1 in VersionsApps select Src_meta.FindLast(v1)); return(versionsSort); }
///<summary>Добавление приложения</summary> public ServiceResult AddAplication(string appName, IApplicationVersionBuilder application) { AppVersion srcV = application.Build(); AppVersion Version = Src_meta.FindLast(appName); AppVersion newVersion = new AppVersion(srcV.VersionName, new VersionNumber(srcV.VersionNumber.Number, Version.VersionNumber.VersionBuildNumber + 1), srcV.Files); if (Version.VersionNumber < newVersion.VersionNumber) { IDictionary <FileOfVersion, byte[]> fileContents = application.FindFileOfVersionsWithData(); ServiceResult service = new ServiceResult(Dst_content.Save(newVersion, fileContents)); Dst_meta.SaveApplication(newVersion); return(service); } else { ServiceResult service = new ServiceResult(false); return(service); } }