Download DOWNLOAD
Forums FORUMS
Blogs BLOGS
Forge FORGE
Help HELP
Marketplace MARKETPLACE
DotNetNuke Home
You are here >   Community > Blogs
Register  |  Login

DNN Blog

May 1

Posted by: Benoit Sarton
2009-05-01 06:41:57Z 

May 1st is labor day, and hard work is honored by doing nothing in most countries.

So my blog this month will require very little effort, if you have built a Store Module Entity Model Class Library with me last month.

Dynamic data is a Scaffold builder, something that exists for a long time in the Ruby on Rails framework.
Basically, a scaffold is an autogenerated set of the CRUD fonctionnalities (Add, Update, Delete, get details, etc).
Combining Dynamic Date with Entity Framework (you might also do this with a Linq Model),
will allow navigating between related tables.

To make it easier and lazy (it's may 1st), we'll do this in a web application outside DotNetNuke.
We will not focus on style sheets, conflicting web.config, packaging into a module, etc.

Prerequisities :

A DotNetNuke Website with Store installed,
framework 3.5 SP1,
the Entity Framework Store Model we built last month..

1. Create a new project outside de DotNetNuke    

Create a new project outside your website folder

 2. Select a "web application Entities Dynamic Data"

3. Add a reference to the Store Model Class Library (my previous blog)

Add a reference to the StoreModel Class library

Solution explorer

4. Add a reference to "System.Data.Entity"

5. Open Global.asax.vb and uncomment the model context registration line

Intellisense should help you find the model : model.RegisterContext(GetType(StoreModel.StoreEntities).

 Also set ScaffoldAllTables = True in the same line.

global.asax

6. Copy and paste the familiar DNN connectionstring section into the web.config. See my last blog for the Entity Framework additional line.

connection string

 

 7.  Register the website in iis and Build.

8. Enjoy your may 1st labor day.

 A single table

 

Scaffolding

 

 Table details

Note the navigation properties (related tables)

Note the related entities which you can easily browse (CartItems, Categories, Reviews)

My selection of Burgundies

My selection of burgundies. You might have selected a Champagne as well.

 

 

 

Tags:

3 comment(s) so far...

Re: Store, Entity framework and Dynamic Data

Dynamic Data is pretty cool, the very fast result you get with scaffolding are amazing.

I spend some days during the last XMas holidays trying to integrate Dynamic Data into DotNetNuke. I stopped when I realized that both approaches are not compatible at all.

By Stefan Cullmann on   2009-05-02 09:06:06Z

Re: Store, Entity framework and Dynamic Data

Donc il faut que je vienne vite à Alès-en-cevennes pour les déguster avec toi ?

:)

By Sebastien Fichot on   2009-05-23 18:37:02Z

Re: Store, Entity framework and Dynamic Data

Stefan : agree. But there should be some way tough. Please have a look at my june blog. Did you follow the same path ? I could not make a real module out of Dynamic Data, but it's ok to package that into an iframe. In the meantime the Iframe module will never die!

Sebastien : salut, quelles nouvelles ?

By Benoit Sarton on   2009-06-02 12:09:48Z

Networks

Follow DNNCorp on Twitter

LinkedIn

Follow us on Twitter @DNNCorp or join the DotNetNuke Community on LinkedIn

Sponsors

DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation

Hosted by MaximumASP