jgauffin/griffin.mvccontrib — pull request #36 by reporcello (2013-02-22 10:56:29+00:00)
Title: Entity Framework support for translation

Hello,
i use mysql a mysql database, so the "SqlServer" can't work.
I've implemented the repositories for EF, so you can use any sql adapter you want.
The implementation is not tested and not perfect (the import method should not work correctly), but hopefully my work could be usefull as a starting point for an improvement.

Paolo

PS
i didn't changed the .sln file to include the new project

PPS (configuration instructions)

By Default there should be in the web.config a connection string named "TranslationDbContext" as the DB name (by EF code first conventions), but. this should be configurated by the Database class, or we can add new contructors to TranslationDbContext.

To initialize it i use this (i use Unity for the DI):
// entity framework
Database.SetInitializer(new CreateDatabaseIfNotExists());
container.RegisterType(new PerThreadLifetimeManager());

// and the repositories
container.RegisterType(new PerThreadLifetimeManager());
container.RegisterType(new PerThreadLifetimeManager());
container.RegisterType(new PerThreadLifetimeManager());