Reputation: 1137
I am wondering if there is any easy way in DotNetNuke 7 to use spacial data types, specifically System.Data.Spacial.DbGeography in regards to reading and writing to a database table.
DotNetNuke utilizes PetaPoco and since it does support using stored procedures I can create a geography entry by passing in Longitude and Latitude. However I can not just pass DbGeography as it errors saying there is no native type.
Then in reading from a data table that has geography data, PetaPoco errors saying IConvertable must be implemented (I do not understand that error and it is probably grounds for a seperate question)
I thought that maybe it be better to forgo PetaPoco and implement Entity Framework 5 Code First in my DotNetNuke project but there seems to be issues where EF can not (easily) map to a pre-existing DotNetnuke database. This blog suggests it required a separate database for EF to use along side the DotNetNuke DB.
Upvotes: 2
Views: 430
Reputation: 2391
If you write a custom DotNetNuke module you can use any other .NET libraries you want and connect to the database on your own terms using Spacial data types or whatever you want. You can connect with ADO .NET, we use Entity Spaces http://www.entityspaces.net/www.entityspaces.net/Portal/Default.aspx.html
I've not used Entity Framework yet since I have been using Entity Spaces for many years and it pretty much does the same thing as EF.
But there is no reason you can't use that library is your custom DNN module.
Upvotes: 2