{"id":684,"date":"2014-02-28T13:19:00","date_gmt":"2014-02-28T13:19:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2014\/02\/28\/announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6\/"},"modified":"2014-02-28T13:19:00","modified_gmt":"2014-02-28T13:19:00","slug":"announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-the-release-of-dynamic-data-provider-and-entitydatasource-control-for-entity-framework-6\/","title":{"rendered":"Announcing the release of Dynamic Data provider and EntityDataSource control for Entity Framework 6"},"content":{"rendered":"<p>Today, we are pleased to announce RTM of ASP.NET Dynamic Data and EntityDataSource control for EntityFramework 6<\/p>\n<h2>What&rsquo;s in this release<\/h2>\n<p>&#8211; Dynamic Data provider for Entity Framework 6<\/p>\n<p>&#8211; EntityDataSource control for Entity Framework 6<\/p>\n<h2>How to install<\/h2>\n<p>You can download this release for ASP.NET DynamicData.EFProvider (<a href=\"http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.DynamicData.EFProvider\/\">http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.DynamicData.EFProvider\/<\/a>) and EntityDataSource (<a href=\"http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.EntityDataSource\/\">http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.EntityDataSource\/<\/a>) from the NuGet gallery.<\/p>\n<ul>\n<li>Install-Package Microsoft.AspNet.DynamicData.EFProvider -Version 6.0.0<\/li>\n<li>Install-Package Microsoft.AspNet.EntityDataSource -Version 6.0.0<\/li>\n<\/ul>\n<h2>Getting started<\/h2>\n<p><strong>Microsoft.AspNet.DynamicData.EFProvider<\/strong><\/p>\n<p>This package has a DynamicData EFProvider for EntityFramework 6. This provider can work with a Model (either Code First or Model First) which was created using Entity Framework 6. This package also installs the Page Templates, Entity Templates and Field Templates which are required for DynamicData. The templates have been updated to use <strong>Microsoft.AspNet.EntityDataSource<\/strong> control which we are also previewing today as well.<\/p>\n<p>For more information on ASP.NET DynamicData please see <a title=\"http:\/\/msdn.microsoft.com\/en-us\/library\/cc488545.aspx\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/cc488545.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/cc488545.aspx<\/a><\/p>\n<p>Following are the steps for using this package in a ASP.NET DynamicData application:<\/p>\n<ul>\n<li>Create a new ASP.NET Dynamic Data Entities Web Application<\/li>\n<li>Add the Microsoft.AspNet.DynamicData.EFProvider NuGet package<\/li>\n<li>This will do the following<\/li>\n<ul>\n<li>Add a reference to the DynamicData EFProvider binary<\/li>\n<li>Install the templates. If you are starting with a new project, then you can override the templates. If you have an existing application, then you should be careful when overriding the changes. These templates will replace the EntityDataSource control which shipped in .NET Framework with Microsoft.AspNet.EntityDataSource and the Page Templates, Field Templates, Entity Templates.<\/li>\n<\/ul>\n<li>Create your model using Entity Framework Code First or EF Designer.<\/li>\n<li>Add the following code in RegisterRoutes in Global.asax.cs to register your DbContext:<\/li>\n<\/ul>\n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:88114b3e-fc94-40f2-86d5-f36beecb58b5\" class=\"wlWriterEditableSmartContent\" style=\"margin: 0px;padding: 0px;float: none\">\n<div style=\"background: #000080;color: #fff;font-family: Verdana, Tahoma, Arial, sans-serif;font-weight: bold;padding: 2px 5px\">Code Snippet<\/div>\n<div style=\"border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt\">\n<div style=\"background: #ddd;max-height: 300px;overflow: auto\">\n<ol style=\"background: #ffffff;margin: 0 0 0 2em;padding: 0 0 0 5px\" start=\"1\">\n<li><span style=\"background: #ffffff;color: #000000\">DefaultModel.RegisterContext(<\/span><\/li>\n<li style=\"background: #f3f3f3\"><span style=\"background: #ffffff;color: #0000ff\">new<\/span><span style=\"background: #ffffff;color: #000000\"> Microsoft.AspNet.DynamicData.ModelProviders.<\/span><span style=\"background: #ffffff;color: #2b91af\">EFDataModelProvider<\/span><span style=\"background: #ffffff;color: #000000\">(() =&gt; <\/span><span style=\"background: #ffffff;color: #0000ff\">new<\/span><span style=\"background: #ffffff;color: #000000\"> YourDbContext()),<\/span><\/li>\n<li><span style=\"background: #ffffff;color: #0000ff\">new<\/span><span style=\"background: #ffffff;color: #2b91af\">ContextConfiguration<\/span><span style=\"background: #ffffff;color: #000000\"> { ScaffoldAllTables = <\/span><span style=\"background: #ffffff;color: #0000ff\">true<\/span><span style=\"background: #ffffff;color: #000000\"> });&nbsp;&nbsp;<\/span><\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:3978d4ea-51d5-4678-bf9e-48b713f33321\" class=\"wlWriterSmartContent\" style=\"margin: 0px;padding: 0px;float: none\">&nbsp;<\/div>\n<ul>\n<li>Run the project<\/li>\n<li>You would see all the tables listed on the Default page.<\/li>\n<\/ul>\n<p><strong>Microsoft.AspNet.EntityDataSource<\/strong> <strong>Control<\/strong><\/p>\n<p>This is an update to the EntityDataSource control which shipped in the .NET Framework. The EntityDataSource control has been updated to work with Entity Framework 6.<\/p>\n<p>To use this control, please do the following<\/p>\n<ul>\n<li>Create an ASP.NET application<\/li>\n<li>Install the package<strong> <\/strong>Microsoft.AspNet.EntityDataSource\n<ul>\n<li>This package will\n<ul>\n<li>Install the runtime binary for <strong><\/strong>Microsoft.AspNet.EntityDataSource<\/li>\n<li>Install the EntityFramework version 6 NuGet package<\/li>\n<li>Add the following tag prefix in web.config<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:129938e1-12b5-44ec-a9c4-d41f339e054f\" class=\"wlWriterEditableSmartContent\" style=\"margin: 0px;padding: 0px;float: none\">\n<div style=\"background: #000080;color: #fff;font-family: Verdana, Tahoma, Arial, sans-serif;font-weight: bold;padding: 2px 5px\">Code Snippet<\/div>\n<div style=\"border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt\">\n<div style=\"background: #ddd;max-height: 300px;overflow: auto\">\n<ol style=\"background: #ffffff;margin: 0 0 0 2em;padding: 0 0 0 5px\" start=\"1\">\n<li><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #a31515\">pages<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span><\/li>\n<li style=\"background: #f3f3f3\">&nbsp;&nbsp;<span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #a31515\">controls<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span><\/li>\n<li>&nbsp;&nbsp;&nbsp;&nbsp;<span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #a31515\">add<\/span><span style=\"background: #ffffff;color: #ff0000\">tagPrefix<\/span><span style=\"background: #ffffff;color: #0000ff\">=<\/span><span style=\"background: #ffffff;color: #000000\">&#8220;<\/span><span style=\"background: #ffffff;color: #0000ff\">ef<\/span><span style=\"background: #ffffff;color: #000000\">&#8220;<\/span><span style=\"background: #ffffff;color: #ff0000\">assembly<\/span><span style=\"background: #ffffff;color: #0000ff\">=<\/span><span style=\"background: #ffffff;color: #000000\">&#8220;<\/span><span style=\"background: #ffffff;color: #0000ff\">Microsoft.AspNet.EntityDataSource<\/span><span style=\"background: #ffffff;color: #000000\">&#8220;<\/span><span style=\"background: #ffffff;color: #ff0000\">namespace<\/span><span style=\"background: #ffffff;color: #0000ff\">=<\/span><span style=\"background: #ffffff;color: #000000\">&#8220;<\/span><span style=\"background: #ffffff;color: #0000ff\">Microsoft.AspNet.EntityDataSource<\/span><span style=\"background: #ffffff;color: #000000\">&#8220;<\/span><span style=\"background: #ffffff;color: #0000ff\"> \/&gt;<\/span><\/li>\n<li style=\"background: #f3f3f3\">&nbsp;&nbsp;<span style=\"background: #ffffff;color: #0000ff\">&lt;\/<\/span><span style=\"background: #ffffff;color: #a31515\">controls<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span><\/li>\n<li><span style=\"background: #ffffff;color: #0000ff\">&lt;\/<\/span><span style=\"background: #ffffff;color: #a31515\">pages<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span><\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<ul>\n<li>Create a new Web Form page<\/li>\n<li>Use the control as follows and bind it to any Databound control such as GridView, FormView etc.<\/li>\n<\/ul>\n<div id=\"scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:1abf3427-1f69-4ed5-becb-7ac551029578\" class=\"wlWriterEditableSmartContent\" style=\"margin: 0px;padding: 0px;float: none\">\n<div style=\"background: #000080;color: #fff;font-family: Verdana, Tahoma, Arial, sans-serif;font-weight: bold;padding: 2px 5px\">Code Snippet<\/div>\n<div style=\"border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt\">\n<div style=\"background: #ddd;max-height: 300px;overflow: auto\">\n<ol style=\"background: #ffffff;margin: 0 0 0 2em;padding: 0 0 0 5px\" start=\"1\">\n<li><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">asp<\/span><span style=\"background: #ffffff;color: #0000ff\">:<\/span><span style=\"background: #ffffff;color: #800000\">GridView<\/span><span style=\"background: #ffffff;color: #ff0000\">ID<\/span><span style=\"background: #ffffff;color: #0000ff\">=&#8221;GridView1&#8243;<\/span><span style=\"background: #ffffff;color: #ff0000\">runat<\/span><span style=\"background: #ffffff;color: #0000ff\">=&#8221;server&#8221;<\/span><span style=\"background: #ffffff;color: #ff0000\">DataSourceID<\/span><span style=\"background: #ffffff;color: #0000ff\">=&#8221;GridDataSource&#8221;&gt;&lt;\/<\/span><span style=\"background: #ffffff;color: #800000\">asp<\/span><span style=\"background: #ffffff;color: #0000ff\">:<\/span><span style=\"background: #ffffff;color: #800000\">GridView<\/span><span style=\"background: #ffffff;color: #0000ff\">&gt;<\/span><\/li>\n<li style=\"background: #f3f3f3\"><span style=\"background: #ffffff;color: #0000ff\">&lt;<\/span><span style=\"background: #ffffff;color: #800000\">ef<\/span><span style=\"background: #ffffff;color: #0000ff\">:<\/span><span style=\"background: #ffffff;color: #800000\">EntityDataSource<\/span><span style=\"background: #ffffff;color: #ff0000\">ID<\/span><span style=\"background: #ffffff;color: #0000ff\">=&#8221;GridDataSource&#8221;<\/span><span style=\"background: #ffffff;color: #ff0000\">runat<\/span><span style=\"background: #ffffff;color: #0000ff\">=&#8221;server&#8221;<\/span><span style=\"background: #ffffff;color: #ff0000\">EnableDelete<\/span><span style=\"background: #ffffff;color: #0000ff\">=&#8221;true&#8221;<\/span><span style=\"background: #ffffff;color: #0000ff\">\/&gt;<\/span><\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<h2>Give feedback<\/h2>\n<p>If you find any issues with this preview, please file issues at the EntityFramework CodePlex site<a href=\"https:\/\/entityframework.codeplex.com\/\">https:\/\/entityframework.codeplex.com<\/a><\/p>\n<p>Thank you for trying out this release.<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we are pleased to announce RTM of ASP.NET Dynamic Data and EntityDataSource control for EntityFramework 6 What&rsquo;s in this release &#8211; Dynamic Data provider for Entity Framework 6 &#8211; EntityDataSource control for Entity Framework 6 How to install You can download this release for ASP.NET DynamicData.EFProvider (http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.DynamicData.EFProvider\/) and EntityDataSource (http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.EntityDataSource\/) from the NuGet gallery. [&hellip;]<\/p>\n","protected":false},"author":408,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[],"class_list":["post-684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet"],"acf":[],"blog_post_summary":"<p>Today, we are pleased to announce RTM of ASP.NET Dynamic Data and EntityDataSource control for EntityFramework 6 What&rsquo;s in this release &#8211; Dynamic Data provider for Entity Framework 6 &#8211; EntityDataSource control for Entity Framework 6 How to install You can download this release for ASP.NET DynamicData.EFProvider (http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.DynamicData.EFProvider\/) and EntityDataSource (http:\/\/www.nuget.org\/packages\/Microsoft.AspNet.EntityDataSource\/) from the NuGet gallery. [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/408"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}