EF5、MVC、およびAutomapperを使用して、あるテーブルから別の一致する(ほぼ)テーブルにレコードを移動しようとしています。このコードは私が使用しているものです:
MyGlobalApplication_Startで
//Create Map and manually map StatusCode to Status
            Mapper.CreateMap<InstitutionStaging, InstitutionStaging_Archive>()
               .ForMember(dest => dest.Status,o =>o.MapFrom(src=>src.StatusCode));
私のコントローラーで
 private MyContext db = new MyContext();
   Public ActionResult ArchiveMe(int id = 0){
  var institutionstaging = db.InstitutionStagings.Find(id);
        if (institutionstaging == null)
        {
            return HttpNotFound();
        }
        if (ModelState.IsValid)
        {  
            var institutionArchive = Mapper.Map<InstitutionStaging, InstitutionStaging_Archive>(institutionstaging);
            //Set Archive date to now.
            institutionArchive.ArchiveDate = DateTime.Now;
//Error happens on the next line
db.InstitutionStaging_Archives.Add(institutionArchive);
            db.InstitutionStagings.Remove(institutionstaging);
            db.Entry(institutionArchive).State = EntityState.Added;
            //Commit the changes
            var result = db.SaveChanges();
            }
}
「ここでエラーが発生します==>」とマークされた行にヒットすると、次のエラーメッセージが表示されます。
{"The entity type InstitutionStaging_Archive is not part of the model for the current context."}
MyContextには、InstitutionStagingとInstitutionStaging_Archiveの両方のDbSetが含まれています。
何が起こっているのか分かりますか?TIA J