数据未保存在数据库的自定义表中,而是保存在模板数据库表中

时间:2019-01-29 15:39:54

标签: c# asp.net entity-framework rest

我正在使用基于令牌的身份验证创建一个Web API,我为我的数据库有一个自定义模型(UserModel),我想在用户注册时在其中存储数据。而不是在发送数据后将其保存在我的自定义表中,而是将其保存在名为aspnetUsers的表中,这是由Web API模板定义的用于保存注册用户的默认表。我如何能够将数据保存在自己的自定义数据库中?我该怎么办?

这是用于asp.Net Web应用程序的Web API。我试图检查DbContext,似乎没有任何工作。我似乎无法弄清楚问题出在哪里

$JBOSS_HOME/modules/com/oracle/ojdbc6/main/

和我的模特:

公共类UserModel     {

Below is my DbContext:
    public class PeppyDbContext : IdentityDbContext<IdentityUser>
    {
    public PeppyDbContext() :base("DefaultConnection",throwIfV1Schema         :false)
    {

    }

    public static PeppyDbContext Create()
    {
        return new PeppyDbContext();
    }

    public DbSet<PeppyAPI.Models.UserModel>UserModels { get; set; }
}

我希望数据存储在我的自定义表(UserModel)中,但存储在asp.net Web API模板定义的默认表(aspnetUsers)中。

0 个答案:

没有答案
相关问题