private Hash ComputeHash() {
            var hash = new Hash();

            // Shell settings physical location
            //   The nhibernate configuration stores the physical path to the SqlCe database
            //   so we need to include the physical location as part of the hash key, so that
            //   xcopy migrations work as expected.
            var pathName = GetPathName(_shellSettings.Name);
            hash.AddString(_appDataFolder.MapPath(pathName).ToLowerInvariant());

            // Shell settings data
            hash.AddString(_shellSettings.DataProvider);
            hash.AddString(_shellSettings.DataTablePrefix);
            hash.AddString(_shellSettings.DataConnectionString);
            hash.AddString(_shellSettings.Name);

            // Assembly names, record names and property names
            foreach (var tableName in _shellBlueprint.Records.Select(x => x.TableName)) {
                hash.AddString(tableName);
            }

            foreach (var recordType in _shellBlueprint.Records.Select(x => x.Type)) {
                hash.AddTypeReference(recordType);

                if (recordType.BaseType != null)
                    hash.AddTypeReference(recordType.BaseType);

                foreach (var property in recordType.GetProperties(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance)) {
                    hash.AddString(property.Name);
                    hash.AddTypeReference(property.PropertyType);

                    foreach (var attr in property.GetCustomAttributesData()) {
                        hash.AddTypeReference(attr.Constructor.DeclaringType);
                    }
                }
            }

            _configurers.Invoke(c => c.ComputingHash(hash), Logger);

            return hash;
        }
        private string GetExtensionHash(ExtensionLoadingContext context, DependencyDescriptor dependencyDescriptor) {
            var hash = new Hash();
            hash.AddStringInvariant(dependencyDescriptor.Name);

            foreach (var virtualpathDependency in context.ProcessedExtensions[dependencyDescriptor.Name].VirtualPathDependencies) {
                hash.AddDateTime(GetVirtualPathModificationTimeUtc(context.VirtualPathModficationDates, virtualpathDependency));
            }

            foreach (var reference in dependencyDescriptor.References) {
                hash.AddStringInvariant(reference.Name);
                hash.AddString(reference.LoaderName);
                hash.AddDateTime(GetVirtualPathModificationTimeUtc(context.VirtualPathModficationDates, reference.VirtualPath));
            }

            return hash.Value;
        }
 public void ComputingHash(Hash hash) {
     hash.AddString("AssetRecord.Ignore.InfoSet");
     hash.AddString("TaskRecord.References.Job.Via.JobId");
     hash.AddString("JobRecord.HasMany.Tasks.KeyColumn.JobId");
 }
 public void ComputingHash(Hash hash) { }
 /// <summary>
 /// Called when configuration hash is being computed. If hash changes, configuration will be rebuilt and stored in mappings.bin.
 /// This method allows to alter the default hash to take into account custom configuration changes.
 /// </summary>
 /// <remarks>
 /// It's a developer responsibility to make sure hash is correctly updated when config needs to be rebuilt.
 /// Otherwise the cached configuration (mappings.bin file) will be used as long as default Orchard configuration 
 /// is unchanged or until the file is manually removed.
 /// </remarks>
 /// <param name="hash">Current hash object</param>
 public virtual void ComputingHash(Hash hash) { }