0

このモデルをスキャフォールディングした後、MVC4 Visual Studio のスキャフォールディング機能には、コンテキスト クラスにクラス 'CompatibleGames' が含まれていません。

public string Name { get; set; }

    public int CategoryId { get; set; }
    public int CompatibleGamesId { get; set; }

    public string Description { get; set; }
    public string ImageUrl { get; set; }
    public int TotalDownloads { get; set; }
    [Range(0,5)]
    public int RatingOutOf5 { get; set; }

    [ForeignKey("CompatibleGamesId")]
    public List<CompatibleGames> compatibleGames { get; set; }

    [ForeignKey("CategoryId")]
    public Category modCategory { get; set; }

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

CompatibleGames プロパティを 1 つのインスタンスに変更したときに、コンテキスト クラスに CompatibleGames モードが含まれていました。

public string Name { get; set; }

    public int CategoryId { get; set; }
    public int CompatibleGamesId { get; set; }

    public string Description { get; set; }
    public string ImageUrl { get; set; }
    public int TotalDownloads { get; set; }
    [Range(0,5)]
    public int RatingOutOf5 { get; set; }

    [ForeignKey("CompatibleGamesId")]
    public CompatibleGames compatibleGames { get; set; }

    [ForeignKey("CategoryId")]
    public Category modCategory { get; set; }

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

スキャフォールド機能が CompatibleGames モデルをコンテキスト クラスに追加できるようにしながら、List プロパティを保持する方法はありますか?

4

0 に答える 0