1

ASP MVCでは、UserProfile最初に次のようなコードを使用してテーブルを更新しました

[Table("UserProfile")]
public class UserProfile
{
    [Key]
    [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
    public int UserId { get; set;}

    public string UserName { get; set; }

    public string FirstName { get; set; }

    public string LastName { get; set; }

    public string Email { get; set; }

    [Required]
    public int State { get; set; }
}

PS状態は、別のテーブルへの外部キーです。

次のステートメントを使用してユーザーを挿入しようとしました

WebSecurity.CreateUserAndAccount(model.UserName, model.Password, new { Email = model.Email, State = state });

エラーが発生します

「オブジェクトタイプStateから既知のマネージドプロバイダーネイティブタイプへのマッピングは存在しません」。

マッピングが存在しない理由がわかりません。

4

0 に答える 0