Use Identity in asp.net mvc 5 project already created

0

I currently have a web app created with ASP.NET MVC 5, which is working with a database already created. At this point I would like to use Identity to create forms and user management to the page, the problem is that I do not know how to make the configuration from start to a page that is already created without losing all the work done. If someone who has had my same problem could help me, I would really appreciate it.

    
asked by Yanir Castillo 21.07.2018 в 20:50
source

1 answer

0

In the end I managed to solve the problem, it's all a matter of writing the connectionString correctly in Web.config .

By default it comes as follows:

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-WebApplication1-20180725105224.mdf;Initial Catalog=aspnet-WebApplication1-20180725105224;Integrated Security=True" providerName="System.Data.SqlClient" />

In this case I replaced it with the form that has the connectionString that creates EntityFramework Code First, which is very similar to this:

  <add name="DefaultConnection" connectionString="data source=TuServidorBD;initial catalog=TuBD;integrated security=True;connect timeout=30;encrypt=False;trustservercertificate=False;applicationintent=ReadWrite;multisubnetfailover=False;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />

I hope it's helpful

    
answered by 27.07.2018 / 14:00
source