c# - ASP.NET MVC 5 Merging ApplicationUser with DbContext -


I am trying to integrate APP identification into my own DBTTENText, but I have no luck with it. The one I am trying to achieve is that every deal that has been posted will be assigned to a user.

DBCTX:

  Public class ShareDealsContext: IdentityDbContext & lt; ApplicationUser & gt; {Public ShareDealsContext (): Base ("name = ShareDealsContext") {} // Other DBSets Public DBSet and LT; Deals & gt; Deals {get; Set; }}   

deal model:

  [foreign key ("user")] Public Virtual String UserId {get; Set; } Public Virtual Application User User {Received; Set; }   

Identity Model:

  Public class ApplicationUser: IdentityUser {public async function   

I have tried to change "DefaultContext" to "ShareDealsContext" inside ApplicationDbContext but still does not work. I want to completely remove DefaultContext and just want to use my own ShareDealsContext. Any thoughts on what I'm missing out on? Thanks

Can you substitute defaultContext with web.config connection string name?

  public applicationDbContext (): base ("CONNECTION_STRING_NAME", throwIfV1Schema: incorrect) For example,  

 Enter image details here

Web.config

 Enter image details here

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -