Reputation: 505
I just installed VS 2012 Premium and I've been following along with the PluralSight ASP.Net MVC 4 Tutorial. I'm on chapter 4 and the project creates a database automatically using EF 4 Code First.
The strange thing is that it creates extra database columns rather than matching the properties in my Restaurant.cs model file.
In Restaurant.cs I have:
namespace OdeToFood.Models
{
public class Restaurant
{
public int ID { get; set; }
public string Name { get; set; }
public Address Address { get; set; }
}
}
However, in the OdeToFoodDB dbo.Restaurants table it generates:
but there are no Street, City, State, and Country properties in the class. In the video the database only has the ID, Name, and Address columns, but I don't know if that might have to do with the fact that he was using EF while it was in the prerelease state. Are there some big assumptions that the new EF makes?
Does anyone have any ideas what is going on here?
I've already deleted the generated database, files in obj and bin, recreated a Restaurant.cs class, uninstalled EF4, and added EF5, but nothing has changed the end result. I'm still getting those extra columns that have nothing to do with my Restaurant.cs file.
Upvotes: 1
Views: 196