c# - asp.net mvc 5.1 mysql Entity Framework Controller Generation -


i have asp.net mvc 5.1 solution 3 projects in shown image below:

folder structure of solution in visual studio

i have ninject, fakeiteasy, mysql nuget packages installed in project , using repository pattern in project have irepository generic interface, idbcontext interface , concrete repository generic class (all in accountmanager.domain). ninject , mysql setup, built solution , far until tried add controller using scaffolding options given entity framework , error saying:

unable retrieve metadata 'accountmanager.domain.entities.bank' using same dbcompiledmodel create contexts against different types of database servers not supported. instead create separate dbcompiledmodel each type of server being used.

i saw when head banging sqlite , ef code first. mean again? see perspective don't?

i have been plugging away @ annoyance while , found simple. decorating context class mysqlefconfig so:

[dbconfigurationtype(typeof(mysqlefconfiguration))] 

helps context make necessary adjustments migration table ef creates automatically works mysql reason why controllers didn't scaffold @ all. got idea try comment out https://stackoverflow.com/users/3671905/yurko , scaffolding worked gorgeously.

only thing note after finished scaffolding need uncomment mysql peculiarities required ef should restored. prefer attribute configuration creating files , editing infrastructure files.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -