简体   繁体   English

如何将ASP.NET Web窗体应用程序从成员身份迁移到ASP.NET Identity 2.0?

[英]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标识:

  1. Convert the ObjectContext to DbContext(and correct the related codes) 将ObjectContext转换为DbContext(并更正相关代码)
  2. Create the new tables needed for ASP.NET Identity and do the data migration. 创建ASP.NET Identity所需的新表并执行数据迁移。
  3. Redefine the account section codes and other dependent codes as needed to match the business logic.(optional) 根据需要重新定义帐户部分代码和其他相关代码以匹配业务逻辑。(可选)

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.

相关问题 将Google的Web表单ASP.NET Membership OpenAuth从OpenID 2.0迁移到OpenID Connect - Migrate web forms ASP.NET Membership OpenAuth for Google from OpenID 2.0 to OpenID Connect 如何在 MVC 应用程序中将 ASP.NET 成员资格迁移到 SAML? - How to migrate ASP.NET membership to SAML in an MVC application? 如何从ASP.NET Web窗体迁移到ASP.NET网页? 即/default.aspx到/ default - How to migrate from ASP.NET Web Forms to ASP.NET Web Pages? i.e /default.aspx to /default 是否可以使用 ASP.NET 成员资格与在 ASP.NET Identity 2.0 中创建的表进行身份验证? - Is it possible to use ASP.NET membership with tables created in ASP.NET Identity 2.0 for authentication? 如何将asp.net成员资格提供程序添加到asp.net Web应用程序? - How to add a asp.net membership provider to asp.net web application? ASP.NET身份和ASP.NET成员资格提供程序“Mashup” - ASP.NET Identity & ASP.NET Membership Provider “Mashup” Asp.net Web表单,Asp身份-如何存储来自Facebook,Twitter等的声明 - Asp.net web forms, Asp Identity - how to store claims from Facebook, Twitter, etc 将用户从自定义表迁移到ASP.NET成员资格表 - Migrate users from custom table to ASP.NET Membership tables 是否存在ASP.NET Web窗体的现成角色/成员资格框架? - Is there a ready made roles/membership framework for ASP.NET Web Forms? 从ASP.Net 4.5向ASP.Net 2.0 Web应用程序发布数据时出错 - Error while posting data from ASP.Net 4.5 to ASP.Net 2.0 web application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM