I have worked out how to do this, so for those who are searching for
the answer:
In the Applicaiton_OnStart enumerate through the configurations which
are made accessible through the ActiveRecordMediator.
foreach (Configuration cfg in
ActiveRecordMediator.GetSessionFactoryHolder().GetAllConfigurations())
{
cfg.AddAuxiliaryDatabaseObject(new
SpatialAuxiliaryDatabaseObject(cfg));
Metadata.AddMapping(cfg, MetadataClass.GeometryColumn);
Metadata.AddMapping(cfg,
MetadataClass.SpatialReferenceSystem);
}
I've amended the Wiki
http://nhforge.org/wikis/spatial/configuration-and-mapping.aspx,
but would just like confirmation this is the best/only place to do
this.
Cheers
Ben
On Nov 27, 1:40 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I'm trying to use the NH.Spatial extensions with SQL 2008, but can't
> work out how I'm supposed to configure it.
> According to the NHForge page (http://nhforge.org/wikis/spatial/
> configuration-and-mapping.aspx) I need to add the dialect, which I
> have done, then it says to
>
> Configuration cfg = new Configuration();
> // Your configuration code (eg. cfg.Configure(); )
> cfg.AddAuxiliaryDatabaseObject(new SpatialAuxiliaryDatabaseObject
> (cfg));
>
> to allow the Schema to be generated properly.
> How do I access the cfg and where do I put it? Do I need to put it on
> the Application_Start or is it something I need to set in the config
> file?
>
> Thanks in advance
>
> Ben
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---