[英]How to migrate ASP.NET Web Forms application from Membership to ASP.NET Identity 2.0?
I have an application which is in .NET Framework version 4.5. 我有一个.NET Framework 4.5版的应用程序。 It uses Web Forms and EntityFramework 6.1.1.
它使用Web Forms和EntityFramework 6.1.1。
The EntityFramework's Context object is of type ObjectContext
. EntityFramework的Context对象的类型为
ObjectContext
。 I'm using ASP.NET Membership(the MembershipProvider is customized ie Custom Membership) for managing the user account related operations. 我正在使用ASP.NET成员资格(MembershipProvider是自定义的,即自定义成员资格),用于管理与用户帐户相关的操作。
I want to migrate my Web Forms application to ASP.NET Identity.
According to http://www.asp.net/identity/overview/migrations/migrating-an-existing-website-from-sql-membership-to-aspnet-identity article I think I have to do the following things to migrate to the ASP.NET Identity: 根据http://www.asp.net/identity/overview/migrations/migrating-an-existing-website-from-sql-membership-to-aspnet-identity文章我认为我必须做以下事情才能迁移到ASP.NET标识:
I have few questions in my mind: 我心里几乎没有问题:
1) I have customized the membership User
table and there are several custom foreign keys associated with the User
table. 1)我已经定制了成员资格
User
表,并且有几个与User
表关联的自定义外键。 Will it still be feasible to migrate to the Identity system without losing any data? 在不丢失任何数据的情况下迁移到Identity系统仍然可行吗?
2) As I'm using EntityFramework so DbContext is needed to migrate to Identity system. 2)因为我正在使用EntityFramework所以需要DbContext才能迁移到Identity系统。 Can I use ObjectContext for ASP.NET Identity migration?
我可以使用ObjectContext进行ASP.NET身份迁移吗?
3) I'm NOT using all the Membership tables as listed at http://i1.asp.net/media/48109/image006.png?cdn_id=2014-11-11-001 . 3)我没有使用http://i1.asp.net/media/48109/image006.png?cdn_id=2014-11-11-001中列出的所有会员表。 (ie aspnet_Applications, aspnet_Membership, aspnet_Paths, aspnet_PersonalizationAllUsers, aspnet_PersonlizationPerUser, aspnet_Profile, aspnet_Roles, aspnet_SchemaVersions, aspnet_Users, aspnet_UsersInRoles, aspnet_WebEvent_Events )
(即aspnet_Applications,aspnet_Membership,aspnet_Paths,aspnet_PersonalizationAllUsers,aspnet_PersonlizationPerUser,aspnet_Profile,aspnet_Roles,aspnet_SchemaVersions,aspnet_Users,aspnet_UsersInRoles,aspnet_WebEvent_Events )
But I am using Application, User, Role, UserInRole, Profile
tables only. 但我只使用
Application, User, Role, UserInRole, Profile
表。 Can I still migrate these table in order to use the ASP.NET Identity? 我是否仍可以迁移这些表以使用ASP.NET标识?
I'm ready to provide more information you may need to understand my current scenario. 我已准备好提供您可能需要的更多信息,以了解我当前的情况。
I'm looking for the correct steps to migrate to Identity, any caution I need to take care, any hurdles I will face? 我正在寻找迁移到身份的正确步骤,我需要注意的任何谨慎,我将面临的任何障碍? Any help is highly appreciated.
任何帮助都非常感谢。
Dave Paquette wrote this http://www.davepaquette.com/archive/2013/12/30/so-you-inherited-an-asp-net-web-forms-application.aspx Dave Paquette写了这篇http://www.davepaquette.com/archive/2013/12/30/so-you-inherited-an-asp-net-web-forms-application.aspx
This may be the answer to your problem. 这可能是您的问题的答案。 Once you have integrated your Web Forms project to MVC, there are plenty of guides online to integrate the new Identity 2.0.
将Web窗体项目集成到MVC后,有大量的在线指南可以集成新的Identity 2.0。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.