Last post Apr 30, 2010 10:17 AM by sjnaughton
Apr 29, 2010 03:44 PM|Savamura|LINK
Hi, I'm trying to play with DynamicData MVC Preview, but I've faced with a problem, trying to create a list action.
I'm using DynamicData in conjunction with LINQ to SQL. I'd like to create dynamic lists of entries of some abstract table. So I've created a controller, which accepts an entity name.
public ActionResult EntriesList(string EntityName)
MetaTable table = null;
if (!MetaModel.Default.TryGetTable(EntityName, out table))
return Error("No such entity.");
Here is where I've stuck. I can get a DataContext and an underlying table itself, but I don't know how to get the entries then and pass them to view, which should be abstract too.
DataContext context = table.CreateContext() as DataContext;
ITable LinqTable = context.GetTable(table.EntityType);
I easilly get what I want using generic method of DataContext: context.GetTabe<SomeTableType>(), but I can't use generic methods here.
Could you please tell me where to move next? And what is the right way to retrieve the rows from MetaTable?
DynamicData MVC Preview
Apr 30, 2010 08:56 AM|sjnaughton|LINK
DynamicData MVC Preview
Hi Savamura, that is no longer supported from the RTM of MVC1 there should be some articles for combining MVC with Dynamic Data & MVS2 and Dynamic Data 4. I'll see if I can fine some [:)]
Apr 30, 2010 09:49 AM|Savamura|LINK
Thank you Steve for your answer, it's a kinda surprise :) that this preview is deprecated.
I've managed to compile that preview to use it with MVC 2.0 and resent RTM version of DynamicData and it seem to work fine.
What I like the most about using the DynamicData with MVC is the full control over the rendering process, but it's not easy to figure out how to retrieve list of rows using only MetaData and DataContext, moreover there are no deep-dive DynamicData topics
or examples available on the Internet. It would be great if you could find some :)
Apr 30, 2010 10:17 AM|sjnaughton|LINK
it's a kinda surprise :) that this preview is deprecated
Well if you look at the way MVC2 is going with EditorFor etc it's only a matter of time before we see some more DD feature comming through.
moreover there are no deep-dive DynamicData topics or examples available on the Internet.
I'm asking around I thought there was one but when I looked I could'nt fine it [:(] I will get back if anyone know of one though.