将 ImpromptuInterface 从 6.2.2 更新到 7.0.1(最新版本)
Updating ImpromptuInterface from 6.2.2 to 7.0.1 (latest version)
我的项目目前引用了 ImpromptuInterface 6.2.2,它运行良好。我正在将我所有的 nuget 包更新到最新版本。
将 ImpromptuInterface 从 6.2.2 更新到 7.0.1 时出现 2 个错误:
- 'Impromptu' 不包含 'InvokeGet'
的定义
- 'Impromptu' 不包含 'GetMemberNames'
的定义
我的代码:
if (Impromptu.GetMemberNames(sourceObject).Any(x => x == newPropertyPath))
{
var newSourceObject = Impromptu.InvokeGet(sourceObject, newPropertyPath);
}
这些方法好像已经不存在了
似乎是ImpromptuInterface that you are using have been moved to a different library, Dynamitey中的方法。 ImpromptuInterface 依赖于 Dynamitey,因此 Dynamitey 应该作为 ImpromptuInterface 升级的一部分添加到您的项目中。
尝试用 Dynamic.InvokeGet
替换 ImpromptuInterface.InvokeGet
,用 Dynamic.GetMemberNames
替换 ImpromptuInterface.GetMemberNames
。您可能还需要添加一行 using Dynamitey;
。
我的项目目前引用了 ImpromptuInterface 6.2.2,它运行良好。我正在将我所有的 nuget 包更新到最新版本。
将 ImpromptuInterface 从 6.2.2 更新到 7.0.1 时出现 2 个错误:
- 'Impromptu' 不包含 'InvokeGet' 的定义
- 'Impromptu' 不包含 'GetMemberNames' 的定义
我的代码:
if (Impromptu.GetMemberNames(sourceObject).Any(x => x == newPropertyPath))
{
var newSourceObject = Impromptu.InvokeGet(sourceObject, newPropertyPath);
}
这些方法好像已经不存在了
似乎是ImpromptuInterface that you are using have been moved to a different library, Dynamitey中的方法。 ImpromptuInterface 依赖于 Dynamitey,因此 Dynamitey 应该作为 ImpromptuInterface 升级的一部分添加到您的项目中。
尝试用 Dynamic.InvokeGet
替换 ImpromptuInterface.InvokeGet
,用 Dynamic.GetMemberNames
替换 ImpromptuInterface.GetMemberNames
。您可能还需要添加一行 using Dynamitey;
。