I want to use entity framework to extend the functionality of Sitecore's membership. As you know, you can't query data efficiently like you can with an SQL database.
I am trying to setup a context class using Code first migrations
public class FilesContext : DbContext
{
public FilesContext() : base("core")
{
Database.CreateIfNotExists();
}
public DbSet<File> Files{ get; set; }
}
The problem is that, the Core database doesn't "exist", when I run the Update-Database. However when I call
ConfigurationManager.ConnectionStrings;
I get a list of the connection strings listed in https://doc.sitecore.net/sitecore_experience_platform/81/setting_up_and_maintaining/xdb/configuring_servers/database_connection_strings_for_configuring_servers
and I am wondering why Entity Framework isn't able to pick up the Sitecore databases. I think, maybe when I run the Update-Database command in Package Manager Console, it just tries to invoke a call to the FilesContext
class and it doesn't see the bigger picture, which is that the site is running under Sitecore.
Core
db schema as this has major implications and there are likely many other ways to achieve what you might be trying to do that won't gravely affect your ability to upgrade in the future, but before I respond with that, I would like to know what you are trying to do.