Esempio n. 1
0
        private Version CheckAsync(Version version)
        {
            try
            {
                var versions = new MongoClient(this.ConnectionString)
                    .GetServer()
                    .GetDatabase(this.DatabaseName)
                    .GetCollection<RemoteVersion>("versions")
                    .AsQueryable();

                var max = versions.Max(v => v.Version);
                var remote = (from v in versions
                              where v.Version == max
                              select v).Single();

                return Version.Parse(remote.Version);
            }
            catch (Exception ex)
            {
                Logger.Error("Impossible to check the remote versions", ex);
                return new Version();
            }
        }