c# - How to create a separate DbCompiledModel for each type of server being used -
i know question has been asked before , have read of them did not me :(
i trying create controller views.
i using ef 6 , had configuration in web.config:
<entityframework> <defaultconnectionfactory type="npgsql.npgsqlfactory, npgsql" /> <providers> <provider invariantname="system.data.sqlclient" type="system.data.entity.sqlserver.sqlproviderservices, entityframework.sqlserver" /> <provider invariantname="npgsql" type="npgsql.npgsqlservices, npgsql.entityframework" /> </providers>
then found out ef6 not support scaffolding downgraded ef version 5. turned out ef 5 not recognize tag removed it:
<entityframework> <defaultconnectionfactory type="npgsql.npgsqlfactory, npgsql" /> </entityframework>
now when try create controllers error:
using same dbcompiledmodel create contexts against different types of database servers not supported. instead, create separate dbcompiledmodel each type of server being used.
this connectionstrings
:
<connectionstrings> <add name="myconnection" connectionstring="server=localhost;database=hotel;user id=postgres;password=6060;" providername="npgsql" /> </connectionstrings>
i know should trivial. excuse noob :(
how fix this?
i post more code if needed.
not solution problem, workaround:
comment connection string in web.config before adding controller, may uncomment it
and i've got no clue why on earth works way
Comments
Post a Comment