public void Initialize() { //这里与 MVC 5 保持一致,只获取所有的属性。 var sourceProperties = SourceType.GetAllPublicReadableProperties(); var targetProperties = TargetType.GetAllPublicReadableProperties(); foreach (PropertyInfo sourcePropertyInfo in sourceProperties) { if (sourcePropertyInfo.IsDefined(typeof(IgnoreFilterAttribute), true)) { continue; } CreatePropertyMap(sourcePropertyInfo, targetProperties); } }