Freigeben über


Answers to frequently asked ASP.NET Dynamic Data questions

Now that ScottGu blogged about it, we have received a number of great feedback and questions.  I'll try to answer some them here.

 

Will this work with MVC?

In this initial Preview, Dynamic Data is mostly targeting 'standard' ASP.NET pages, but we are absolutely planning to support Dynamic Data for MVC.  And the good news is that you can actually try this today!  To do this:

This was completely unadvertised, so most folks probably didn't see it, but it's in there for you to play with!  Start by just running it, and then look through the source code, which is all part of the solution.  Of course, it's all very preliminary, and far from feature complete, but it should give you an idea of where we're heading.  If there is enough interest, I'll try to make a screen cast that shows it.

 

Will it support databases other than SQL Server?

Yes, this is a key requirement for us.  In the Preview build, Dynamic Data runs on top of Linq To Sql, which only supports SQL Server.  But in the near future, it will also support Linq To Entities, which supports other databases like Oracle.

 

Will it support Many to Many relationships?

Yes, this will be fully supported with Linq To Entities.  Linq To Sql does not directly support Many to Many relationships, though it can be achieved with some extra steps (see for example this post).  But with Entities, it will work with much less effort.

 

Is this feature for prototyping,  or for real applications?

The answer is that it really is for both.  By using the initial scaffolding, you instantly get a working app.  For some admin scenarios, it may actually be good enough as is, but for most other scenarios that need to be more polished, you can deeply customize it, while preserving many of the benefits.

The customization of a Dynamic Data app happens at many level, which I briefly described my my previous post.  Again, I'll try to go deeper into the various scenarios in future posts.

 

Can I use it with an existing app?

If you have an  existing ASP.NET application that already uses Linq To Sql, then you should be able to add some Dynamic Data goodness in there, simply by using some of the new controls in your pages.  e.g. A DynamicControl contains the logic that drives the rendering of a field via the Field Template mechanism.

There are some aspects that are a little trickier, like getting your existing pages to automatically link to each other (e.g. for traveling foreign  key relationships).  That's not as easy as it could be today, but we are working on improving this support.

 

Can I use multiple Data Contexts in my application?

With the Preview bits, you can only use one, but future builds will remove this restriction.  You will be able to register multiple contexts with the Dynamic Data engine, and it will work with all of them.

 

Why is Dynamic Data using a sort of routing section in web.config, while the new MVC does routing in global.asax?

Well, we basically didn't have time to make those two  things come together in the Preview, but future builds will  make Dynamic Data use the exact same routing mechanism as MVC.  To be clear that means both the MVC and the non-MVC (aka WebForms) flavors of Dynamic Data will rely on this routing mechanism.  As a result, most of what we have in web.config today will disappear.

 

I have seen some mentions of 'Oryx'.  How does it relate to Dynamic Data?

'Oryx' is the internal code name for Dynamic Data, although the name has been used a few times publicly.  In any case they refer to exactly the same thing.  As for the name 'Dynamic Data', we may or may not stick with it as the official name when this is released.  If you have a great naming suggestion, send it my way! :-)

Comments

  • Anonymous
    December 14, 2007
    PingBack from http://dotnet.robertmao.com/2007/12/14/aspnet-mvc-dynamic-data-sample/

  • Anonymous
    December 15, 2007
    ASP.NET New ASP.NET Dynamic Data Support [Via: ScottGu ] Answers to frequently asked ASP.NET Dynamic...

  • Anonymous
    December 15, 2007
    Link Listing - December 14, 2007

  • Anonymous
    December 15, 2007
    I watched your screencast in your previous post that is the best one. It look like ASP.NET AJAX. Does it come to replace ASP.NET AJAX?

  • Anonymous
    December 16, 2007
    I liked you previous screencast and am sure your next one will also be good. Throw in a many 2 many relatios please

  • Anonymous
    December 16, 2007
    The comment has been removed

  • Anonymous
    December 17, 2007
    Does it support / will it support:

  1. Composite keys
  2. Many 2 Many relationships
  • Anonymous
    December 18, 2007
    Good questions Mischa.  I just added a note about Many To Many support.  Composite primary keys are supported today (e.g. OrderDetails in Northwind).  Composite foreign keys are currently broken, but we will fix this.

  • Anonymous
    December 18, 2007
    The comment has been removed

  • Anonymous
    December 18, 2007
    Werner, could I ask you to post your question to the forum instead (http://forums.asp.net/1145.aspx)?  This way we can have more people from the team helping with it. One thing: make sure that you create your web site using the new 'Dynamic Data WebSite' template. Let's follow up on the forum.

  • Anonymous
    June 05, 2008
    Now that ScottGu blogged about it , we have received a number of great feedback and questions.  I'll try to answer some them here.   Will this work with MVC? In this initial Preview, Dynamic Data is mostly targeting 'standard' ASP.NET

  • Anonymous
    August 21, 2008
    ASP.NET里的支架:DynamicDataSupport 作者HartmutWilms译者张海龙发布于2007年12月23日下午10时44分 社区 .NET 主题 ...