Wednesday, October 1, 2008

ASP.NET Dynamic Data and other ORMs

Searching to see if I could use with the ASP.NET Dynamic Data some other ORMs besides the EF and LINQ to SQL, I stepped on ValidDataContextType method from the System.Web.DynamicData.ModelProviders.SchemaCreator. The method body looks like this and I think it provides enough information about the extending to other ORMs:
public virtual bool ValidDataContextType(Type contextType){
if (!IsDataContext(contextType)){
return IsObjectContext(contextType);
}
return true;
}
The only valid DataContexts are System.Data.Linq.DataContext or System.Data.Objects.ObjectContext. So if you want to extend the ASP.NET Dynameic Data you can do this by implementing a LINQ2 or EF provider to some database. Here, Frans Bouma gives more references aboute this issue.

0 comments: