將automapper版本從4.2.1更新到5.0.0後,發生SourceValue缺失的compilateion錯誤。 這是我的例子Automapper 5.0.0缺少SourceValue(自定義轉換器)
public class DraftLayoutCellPropertiesConverter : ITypeConverter<DraftLayoutCell, DraftGamePeriodDraftLayoutViewModel>
{
public DraftGamePeriodDraftLayoutViewModel Convert(ResolutionContext context)
{
var input = context.SourceValue as DraftLayoutCell;
var result = new DraftGamePeriodDraftLayoutViewModel();
if (input != null)
{
什麼應該是該屬性的替代?這是做自定義轉換器的最佳方式嗎?我期待的更新不會破壞現有的代碼,因爲有很多人使用該應用程序。