Just a suggestion ... It would be nice to provide a fluent provider for "true 1, false 0, yes 'Y', no 'N'" as well ...
On Wed, Mar 11, 2009 at 5:18 AM, Karron Qiu <[email protected]> wrote: > I like fluent nhibernate project very much. It provides a fluent api to > configure nhibernate. I tried to port the configuration to ar. This is still > a very rough implementation yet. > > I created a ARCfgSourceAdapter that implement IConfigurationSource. And > created a PersistenceConfiguration to configure all the information. > > how to use it? there is some sample codes. > > var cfg = new ARFluentConfiguration(); > > cfg.Database(MsSqlConfiguration<ActiveRecordBase> > .MsSql2005() > .FromConnectionStringWithKey("TestConnection") > .Driver<ExtSqlClientDriver>() > .ShowSql() > .QuerySubstitutions("true 1, false 0, yes 'Y', > no 'N'") > .AdoNetBatchSize(100) > ); > > //If there is another database, you should config like this > > //cfg.Database<AnotherEntityBase>(MsSqlConfiguration<AnotherEntityBase> > // > .MsSql2005<AnotherEntityBase>(cfg.ConfigurationSource) > // > .FromConnectionStringWithKey("AnotherTestConnection") > // .Driver<ExtSqlClientDriver>() > // .ShowSql() > // .QuerySubstitutions("true 1, false 0, yes > 'Y', no 'N'") > // .AdoNetBatchSize(100) > // ); > > cfg.ConfigureConfigurationSource(c => > c.AddFromAssemblyOf<Parent>() > .SetIsWeb(false) > > .SetPluralizeTableNames(true) > ); > > ActiveRecordStarter.Initialize(cfg.ConfigurationSource.Assemblies.ToArray() > , cfg.ConfigurationSource); > > > I attached my codes for your reference. > > > -- > Regards, > Karron > > > > -- It is the mark of an educated mind to be able to entertain a thought without accepting it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Development List" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en -~----------~----~----~----~------~----~------~--~---
