After MUCH research into Entity Framework (targeting DNX 4.5.1) I keep coming to the same conclusion that when using the code-first approach EF is supposed to create any tables that do not exist.
DbContext:
public class AccountReadContext : DbContext
{
public AccountReadContext(DbContextOptions options)
: base(options)
{}
public DbSet<AccountRead> AccountReads { get; set; }
}
Database Provider:
public void AddAccountRead(AccountRead reads)
{
_dbContext.AccountReads.Add(reads);
_dbContext.SaveChanges(); //System.Data.SqlClient.SqlException (0x80131904): Invalid object name 'AccountRead'
}
I know why this is happening (the table is missing). What I can't figure out is how do I get code-first to do its thing and create the table?