Exemplo n.º 1
0
        public bool NeedsUpgrade(string applicationName)
        {
            IVersionProvider provider = versionProviderFactory.Get(applicationName);

            if (provider == null)
            {
                log.LogInformation("IVersionProvider not found for " + applicationName);
                return(true);
            }

            Version codeVersion = provider.GetCodeVersion();

            Guid    appId         = db.GetOrGenerateSchemaApplicationId(applicationName);
            Version schemaVersion = db.GetSchemaVersion(appId);

            bool result = false;

            if (codeVersion > schemaVersion)
            {
                //log.LogInformation(applicationName + " needs upgrade");
                result = true;
            }

            return(result);
        }
Exemplo n.º 2
0
        public Version GetCodeVersion(string applicationName)
        {
            IVersionProvider coreVersionProvider = versionProviderFactory.Get(applicationName);

            if (coreVersionProvider != null)
            {
                return(coreVersionProvider.GetCodeVersion());
            }

            return(null);
        }
Exemplo n.º 3
0
        public Version GetCloudscribeCodeVersion()
        {
            IVersionProvider coreVersionProvider = versionProviderFactory.Get("cloudscribe-core");

            //if (VersionProviderManager.Providers["cloudscribe-core"] != null)
            if (coreVersionProvider != null)
            {
                return(coreVersionProvider.GetCodeVersion());
            }

            return(new Version(0, 0, 0, 0));
        }