ctp4

Using Entity Framework Code First CTP4 how to map an entity to multiple tables?

Using CTP4 and Code First, is it possible to map a single entity to two tables (using a 1-1 relationship between the two tables)? If so, how? MSDN: "How to: Define a Model with a Single Entity Mapped to Two Tables" http://msdn.microsoft.com/en-us/library/bb896233.aspx Related: http://stackoverflow.com/questions/3880237/mapping-data-...

Code First CTP4: How to map these two entities

Let's say that I have two entities, Team and Match. In every Match, there are two teams, the HomeTeam and the AwayTeam. A Team can have many matches, but HomeTeam and AwayTeam can only have one team each. Sometimes Team is a HomeTeam, and sometimes the same Team is an AwayTeam. I have provided just the basics for each of the classes: pu...

Entity Framework CTP 4 - Code First Custom Database Initializer

I would like to implement a custom database initialization strategy so that I can generate the database schema and apply it to an EXISTING EMPTY SQL database using a supplied User ID and Password. Unfortunately the built-in strategies don’t provide what I’m looking for: // The default strategy creates the DB only if it doesn't exist -...

Entity Framework Code First CTP4 Default Column Values?

I have been looking into Code First with Entity Framework CTP4 and you can use the ModelBuilder to build up your table columns. Is there a way to set the default value for a column in the database using the ModelBuilder or some other mechanism? Thank You! ...