Esempio n. 1
0
        public Configuration ConfigureDefault(NConnection connection)
        {
            var fluentConfig = Fluently.Configure();

            fluentConfig = connection.IsTesting ?
                fluentConfig.Database(SQLiteConfiguration.Standard.InMemory()) :
                fluentConfig.Database(
                    MsSqlConfiguration.MsSql2008
                    .ConnectionString(c =>
                    {
                        c.Server(connection.Server);
                        c.Database(connection.Database);
                        c.Username(connection.User);
                        c.Password(connection.Password);

                        if (connection.TrustedConnection)
                        {
                            c.TrustedConnection();
                        }
                    })
                );

            fluentConfig = DoMappingsFromAssembly(fluentConfig);

            return fluentConfig.BuildConfiguration();
        }