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.
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<ITranslationDbContext, TranslationDbContext>(new PerThreadLifetimeManager());
// and the repositories
container.RegisterType<ILocalizedTypesRepository, EFLocalizedTypesRepository>(new PerThreadLifetimeManager());
container.RegisterType<IViewLocalizationRepository, EFLocalizedViewsRepository>(new PerThreadLifetimeManager());
container.RegisterType<ITypePromptImporter, EFLocalizedTypesRepository>(new PerThreadLifetimeManager());
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.
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<ITranslationDbContext, TranslationDbContext>(new PerThreadLifetimeManager());
// and the repositories container.RegisterType<ILocalizedTypesRepository, EFLocalizedTypesRepository>(new PerThreadLifetimeManager()); container.RegisterType<IViewLocalizationRepository, EFLocalizedViewsRepository>(new PerThreadLifetimeManager()); container.RegisterType<ITypePromptImporter, EFLocalizedTypesRepository>(new PerThreadLifetimeManager());