Search code examples
c#impromptu-interface

Updating ImpromptuInterface from 6.2.2 to 7.0.1 (latest version)


My project currently references ImpromptuInterface 6.2.2 and it works great. I am in the process of updating all my nuget packages to latest version.

When updating ImpromptuInterface from 6.2.2 to 7.0.1 I got 2 errors:

  • 'Impromptu' does not contain a definition for 'InvokeGet'
  • 'Impromptu' does not contain a definition for 'GetMemberNames'

My code:

if (Impromptu.GetMemberNames(sourceObject).Any(x => x == newPropertyPath))
{
    var newSourceObject = Impromptu.InvokeGet(sourceObject, newPropertyPath);
}

It seems these methods does no longer exists.


Solution

  • It seems the methods in ImpromptuInterface that you are using have been moved to a different library, Dynamitey. ImpromptuInterface depends on Dynamitey, so Dynamitey should have been added to your project as part of the ImpromptuInterface upgrade.

    Try replacing ImpromptuInterface.InvokeGet with Dynamic.InvokeGet and ImpromptuInterface.GetMemberNames with Dynamic.GetMemberNames. You might need to add a line using Dynamitey; as well.