ビューモデル(以下を参照)で検証された画像アップロードフィールドと名前フィールドを含むフォームを作成しようとしています。IFormFileをMVC6のビューモデルに配置する方法
InvalidOperationException: The property 'ImageUpload' on entity type 'BallWallWebApp.ViewModels.Slides.CreateSlideViewModel' has not been added to the model or ignored.
Microsoft.Data.Entity.Metadata.Conventions.Internal.PropertyMappingValidationConvention.Apply(InternalModelBuilder modelBuilder)
コード:
using Microsoft.AspNet.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
namespace BallWallWebApp.ViewModels.Slides
{
public class CreateSlideViewModel
{
[Required]
public int WallId { get; set; }
[Required]
[Display(Name = "Slide Name")]
[DataType(DataType.Text)]
public string Name { get; set; }
[Required]
[Display(Name = "Slide image file")]
[DataType(DataType.Upload)]
public IFormFile ImageUpload { get; set; }
}
}
は、私が何をしないのです問題は、私は、Visual Studio(サイトを開始)で、このクラスまたはヒットのプレイを考慮して、私のデータベースを移行するとき、私は次のエラーを取得することです?