【发布时间】:2015-10-14 18:51:14
【问题描述】:
我有一个 web api 2 应用程序,我在其中使用了 asp.net 身份 2.0 和实体框架。在我的 MySql 数据库中,我添加了这个表 ajt_collaborator
CREATE TABLE `ajt_collaborator` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`marital_status` enum('M','MLLE','MME') DEFAULT NULL,
`address` text,
`Nom` text,
`Prenom` text,
`id_user_fk` varchar(128) NOT NULL,
`deletion_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `collaborator_user_fk` (`id_user_fk`),
CONSTRAINT `collaborator_user_fk` FOREIGN KEY (`id_user_fk`) REFERENCES `aspnetusers` (`Id`)
)
指aspnetusers
CREATE TABLE `aspnetusers` (
`Id` varchar(128) NOT NULL,
`Hometown` text,
`Email` varchar(256) DEFAULT NULL,
`EmailConfirmed` tinyint(4) NOT NULL,
`PasswordHash` text,
`SecurityStamp` text,
`PhoneNumber` text,
`PhoneNumberConfirmed` tinyint(4) NOT NULL,
`TwoFactorEnabled` tinyint(4) NOT NULL,
`LockoutEndDateUtc` datetime DEFAULT NULL,
`LockoutEnabled` tinyint(4) NOT NULL,
`AccessFailedCount` int(11) NOT NULL,
`UserName` varchar(256) NOT NULL,
PRIMARY KEY (`Id`)
)
我需要将这些表合并到第二个表中,并在应用程序中识别aspnetusers 的其他属性。
- 可以这样做吗?
- 实现这一目标的步骤是什么?
【问题讨论】:
标签: mysql .net entity-framework asp.net-mvc-4 asp.net-identity