FluentNHibernate.PersistenceModel.ApplyConventions C# (CSharp) Method

ApplyConventions() public method

public ApplyConventions ( ) : void
return void
        public void ApplyConventions()
        {
            if (conventionsApplied) return;

            // we do this now so user conventions are applied first, then any defaults
            AddDefaultConventions();

            var conventions = ConventionFinder.Find<IEntireMappingsConvention>() ?? new List<IEntireMappingsConvention>();

            // HACK: get a list of IClassMap from a list of IMappingProviders
            var classes = new List<IClassMap>();

            foreach (var provider in mappings.Where(x => x is IClassMap))
                classes.Add((IClassMap)provider);

            foreach (var convention in conventions)
            {
                if (convention.Accept(classes))
                    convention.Apply(classes);
            }

            conventionsApplied = true;
        }