如何将Aspnet_User加入我的自定义用户

时间:2013-02-17 10:55:49

标签: c# entity-framework entity-framework-5

我有一个User模型对象,当我得到这个对象以获取aspnet_User对象以获取其他数据(usename等)时,我不想这样做。)

public class User
    {
        public Guid UserId_fk { get; set; }
        public int UserId { get; set; }
        public string FirstName { get; set; }

        public virtual AspnetUsers AspnetUsers { get; set; } 

    }

public class AspnetUsers
    {
        public Guid ApplicationId { get; set; }
        public Guid UserId { get; set; }
        public string UserName { get; set; }
        public string LoweredUserName { get; set; }
        public string MobileAlias { get; set; }
        public bool IsAnonymous { get; set; }
        public DateTime LastActivityDate { get; set; }

    }

在数据库UserId_fk中是FK to aspnet_Users.UserId。 如何映射?

0 个答案:

没有答案