単純なモデルをエンティティにマップしようとしていますが、予期していなかったマップされていないアイテムのリストを取得します。AutomapperCfg の検証行で失敗します。
SaveImportRunDetailsModel -> ImportRunDetailEntity (宛先メンバー リスト) FCSD.Models.SaveImportRunDetailsModel -> LLBLGEN.EntityClasses.ImportRunDetailEntity (宛先メンバー リスト)
マップされていないプロパティ:
Id
ConcurrencyPredicateFactoryToUse
AuthorizerToUse
AuditorToUse
Validator
ActiveContext
IsNew
Fields
IsDirty
これらはシステム生成アイテムのように見えますが、それらを閉じる方法はありますか?
AutomapperCfg.cs は
using AutoMapper;
using FCSD.Models;
using LLBLGEN.EntityClasses;
namespace FCSD.Automapper
{
public class AutomapperCfg : IAutomapperCfg
{
public void Configure()
{
Mapper.Initialize(cfg =>
{
cfg.CreateMap<CategoryEntity, Category>(MemberList.Destination);
cfg.CreateMap<EnglishPartInfoEntity, EnglishPartModel>(MemberList.Destination);
cfg.CreateMap<ImageEntity, Image>(MemberList.Destination);
cfg.CreateMap<ImportRunDetailEntity, ImportRunDetailModel>(MemberList.Destination);
cfg.CreateMap<ModelExportBaseEntity, Model>(MemberList.Destination).ReverseMap();
cfg.CreateMap<PartEntity, Part>(MemberList.Destination);
cfg.CreateMap<SaveImportRunDetailsModel, ImportRunDetailEntity>(MemberList.Destination);
});
Mapper.AssertConfigurationIsValid();
}
}
}
SaveImportRunDetailsModel は
using System;
namespace FCSD.Models
{
public class SaveImportRunDetailsModel
{
public string PHCreationDate { get; set; }
public DateTime RunTimestamp { get; set; }
}
}
最後に、ImportRunDetailEntity は少し長く (400 行以上)、LLBLGen Pro から c# で自動生成されます。