【问题标题】:How to connect AspNetUsers with another table?如何将 AspNetUsers 与另一个表连接?
【发布时间】:2017-12-12 06:11:12
【问题描述】:

大家好,StackOverflow 的人。 我目前有一张客户桌:

 public class Cliente
    {
        public Cliente()
        {
        }

        [Key]
        public int IDCliente { get; set; }

        [Required]
        public string Nome { get; set; }

        [Required]
        public string Morada { get; set; }

        [Required]
        public string Email { get; set; }

        [Required]
        public string UserName { get; set; }
    }
}

我有 AspNetUsers 表...

另外,这是我的客户表数据。

我在 Cliente 表上有那个用户名,我想把它连接到 aspnetUsers,这样当我创建一个用户时,它会自动在两者之间自动添加信息。 怎么可能?

提前致谢。

【问题讨论】:

    标签: entity-framework model-view-controller model entity


    【解决方案1】:

    您可以自定义继承基本 UserManager 的 UserManager ,然后在覆盖 CreateUser 函数实现中添加 Cliente。

    【讨论】:

      猜你喜欢
      • 2020-11-30
      • 1970-01-01
      • 1970-01-01
      • 2015-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多