Ejemplo n.º 1
0
        public static Configuration GetDefaultNHConfiguration(bool autoMapAll = false)
        {
            var cfg = new Configuration();

            cfg
            .CurrentSessionContext <ThreadStaticSessionContext>()
            .DataBaseIntegration(x => {
                x.FullDriver(ConfigurationManager.AppSettings["nhibernate.dbdriver"] ?? "mssql2012");
                x.ConnectionStringName = "acrframework";
            });

            if (autoMapAll)
            {
                cfg.AddAssemblyByCodeMap <AcrModelMapper>(Assembly.GetExecutingAssembly());
            }
            return(cfg);
        }
 public static Configuration AddAssemblyByCodeMap(this Configuration config, Assembly assembly)
 {
     return(config.AddAssemblyByCodeMap(new ModelMapper(), assembly));
 }
 public static Configuration AddAssemblyByCodeMap <T>(this Configuration config, Assembly assembly) where T : ModelMapper, new()
 {
     return(config.AddAssemblyByCodeMap(new T(), assembly));
 }