Ejemplo n.º 1
0
        public static AuditConfiguration GetFor(Cfg.Configuration cfg)
        {
            if (!configurations.TryGetValue(cfg, out var verCfg))
            {
                cfg.SetEnversProperty(ConfigurationKey.UniqueConfigurationName, Guid.NewGuid().ToString());
                cfg.BuildMappings();                 // force secondpass for mappings added by users
                if (!configurationMetadataProvider.TryGetValue(cfg, out var metas))
                {
                    metas = new AttributeConfiguration();
                }
                verCfg = new AuditConfiguration(cfg, metas);
                configurations.Add(cfg, verCfg);
            }

            return(verCfg);
        }
Ejemplo n.º 2
0
        public static AuditConfiguration getFor(Cfg.Configuration cfg)
        {
            AuditConfiguration verCfg = null;

            if (cfgs.Keys.Contains(cfg))
            {
                verCfg = cfgs[cfg];
            }
            else
            {
                verCfg = new AuditConfiguration(cfg);
                cfgs.Add(cfg, verCfg);

                cfg.BuildMappings();
            }

            return(verCfg);
        }