简体   繁体   English

如何首先在ASP.NET MVC中将Identity与Entity Framework数据库一起使用

[英]How to use Identity with Entity Framework database first in ASP.NET MVC

When I try to use Identity with EF database first , I get the following error 当我尝试首先将Identity与EF 数据库一起使用时,出现以下错误

Missing partial modifier on declration of type 'MyProject.Models.UserProfile' another partial declration of this type exist. 类型'MyProject.Models.UserProfile'的偏斜缺少部分修饰符,此类型的另一部分偏斜存在。

Basically I get this error because there is a partial class called UserProfile that exist in AccountModel class and another class with the same name that represent the Table generated using Identity . 基本上,我得到这个错误,因为有一个partial class称为UserProfile中存在的AccountModel类和其他class与代表相同的名称Table使用Identity生成。

So what should I do? 所以我该怎么做?

确保定义的两个类都使用“部分”修饰符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET MVC 4实体框架数据库第一个存储库 - ASP.NET MVC 4 Entity Framework Database First Repository 如何使用“代码优先实体框架”在ASP.NET MVC 4中创建数据库并将其连接到数据库? - How to create a database and connect to it in ASP.NET MVC 4 by using Code First Entity Framework? ASP.NET MVC - 如何首先使用实体框架模型/数据库部署到 Azure? - ASP.NET MVC - How to Deploy to Azure using Entity Framework Model/Database First? 如何在ASP.NET MVC 5和身份(实体框架优先)中将用户链接到另一个用户 - How can I link a user to another user in ASP.NET MVC 5 and Identity (Entity Framework Code-First) 如何将Asp.net身份与数据库一起使用 - how to Use Asp.net Identity with DataBase first approach 具有自己的表定义的ASP.NET身份实体框架数据库第一种方法 - Asp.net identity entity framework database first approach with own table defintion 使用实体框架和标识分离 ASP.NET MVC 中的模型 - Separating Models in ASP.NET MVC with Entity Framework and Identity 实体框架的MVC(ASP.NET身份)自定义登录状态 - MVC (ASP.NET Identity) custom Signin Status with Entity Framework 如何在Asp.Net 5中使用Entity Framework 6.x(MVC 6) - How to Use Entity Framework 6.x in Asp.Net 5 (MVC 6) 使用实体框架将asp.net Identity实现到现有数据库中 - Implementing asp.net Identity into already existing database with entity framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM