Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Unassigned: [Investigate EF6] Designer: update model from database broken [1543]

$
0
0
Using the sql compact provider it is fairly easy to break a lot of the mappings for the model and to get the model in a state where it won't update from the database

Repro:
* Install packages from aspnet nightly and main feed
```
PM> Install-Package entityframework.Sqlservercompact -pre -version 6.0.0-rc1-20807
PM> Install-Package ChinookDatabase.SqlServerCompact
```
* Build
* Add new ADO.NET Entity Data Model generated from Chinook.sdf
* update program.cs as shown below
* from designer surface: Generate Database from Model then save the script
* add image column to Album table in chinook.sdf
* from designer surface: update model from database
* NOTE: in the error list there are a bunch of broken mappings and the model isn't updated to match database changes


program.cs:
```
using System;

namespace DesignerRetarget
{
class Program
{
static void Main(string[] args)
{
using (var db = new ChinookEntities())
{
Console.WriteLine("Album");
foreach (var album in db.Albums)
{
Console.WriteLine(album.Title + " by " + album.Artist.Name);
}

Console.WriteLine("\nPress any key to exit...");
Console.ReadKey();
}
}
}
}

```

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>