【发布时间】:2023-03-25 23:25:02
【问题描述】:
默认情况下,ASP.NET Identity 用户数据存储在 mdf 文件中。
我想将数据存储在 Sql 数据库中,以便将 web.config 中的默认连接字符串更改为基于 EF 的连接:
<add name="DefaultConnection" connectionString="metadata=res://*/Models.StartifyModel.csdl|res://*/Models.StartifyModel.ssdl|res://*/Models.StartifyModel.msl;provider=System.Data.SqlClient;provider connection string="data source=MYPC\SQLEXPRESS;initial catalog=mydb;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
现在我一想注册用户就收到错误The entity type ApplicationUser is not part of the model for the current context.。
我使用VS2013默认的MVC5项目模板。
【问题讨论】:
标签: asp.net sql asp.net-mvc entity-framework asp.net-identity