c# - Azure mvc web app deploy with 2 dbcontexts and class library -
hi guys trying deploy mvc application azure. far, ive done half of work. so, main web application aplicationdbcontext identity2.0 tables user , roles , on. now, have dal class library model , quizcontext rest of application. use 1 instance of database storing these 2 contexts , u can see server explorer on left done on localhost, when try publish on azure mvc web project deployed. sure ive connected sql management studio azure database , shows identity tables. after searching few days online find solution gave cuz basic stuff.
can u me make happen :d goal deploy web application class library(s) , 2 dbcontexts using 1 database on azure.
thank u much.
link pictures u better understanding of problem
there no error msg. @ publish console project published - 1 , thats it.
this dbcontext class library
namespace quiz.dal { public class quizcontext : dbcontext { public quizcontext() : base("name=defaultconnection") { } public virtual dbset<option> options { get; set; } public virtual dbset<question> questions { get; set; } public virtual dbset<category> categories { get; set; } public virtual dbset<test> tests { get; set; } } }
this dbcontext mvc web application
namespace quiz.models { public class applicationdbcontext : identitydbcontext<applicationuser> { public applicationdbcontext() : base("defaultconnection", throwifv1schema: false) { } public static applicationdbcontext create() { return new applicationdbcontext(); } } }
this connection string mvc web project, dal class library not have connection string
<connectionstrings> <add name="defaultconnection" connectionstring="data source=(localdb)\mssqllocaldb;attachdbfilename=|datadirectory|\quiz.mdf;initial catalog=quiz;integrated security=true" providername="system.data.sqlclient" /> </connectionstrings>
Comments
Post a Comment