Welcome to the CodeSmith Community!

How to make CodeSmith working with NHibernate + PostGIS

Template Frameworks

A description has not yet been added to this group.

How to make CodeSmith working with NHibernate + PostGIS

Answered (Verified) This question is answered

Hi my friends,


I have just configured CodeSmith working ok with PostgreSQL database on NHibernate Frameworks. And I know that NHibernate.Spatial make NHibernate support PostGIS database in PostgreSQL.

Now I want to make CodeSmith working with PostGIS database. How can I do this?


Thanks for your attention,

  • Post Points: 35
Verified Answer
  • Hello,

    I believe this is something the provider supports out of the box.. I know that there is no specific template and provider logic to return these custom mapped types, but the columns native type would be correct and you could generate off of the native type.

    If you select a table column in the Database Explorer and look at it's Extended Properties (right click -> extended properties) or look in the properties window. You can see that the native type is the PostGIS type. The DbType property would be set to DbType.Object and their is an ExtendedProperty called "NpgsqlDbType" which would contain the Postgres DbType object mapping. I believe both the DbType properties would be incorrect (Mapped to DbType.Object).

    The PostgresSchemaProvider's code can be updated to support this. We release the source code to all of our database providers. Please check your My Documents folder for (Documents\CodeSmith Generator\Samples\v5.3\Projects\CSharp\PostgreSQLSchemaProvider).

    Please let us know if you have any questions.


    -Blake Niemyjski

    Blake Niemyjski
    CodeSmith Tools, LLC. Software Development Engineer
    Blog: http://windowscoding.com/blogs/blake/
    .NetTiers team | Visit http://www.nettiers.net

All Replies
Page 1 of 1 (11 items)