Skip to main content

Not sure if I am missing something, but I have been having trouble overriding the SaveBucketImport method under 22r2 in the BC Connector.  The prior definitions did not include the optional parameter CancellationToken.

The new original signature  looks like :

public override async Task SaveBucketImport(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken = default)

 

In my extension I have

 public delegate Task SaveBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken = default);

        ÂPXOverride]
        public virtual async Task SaveBucketImport(BCSalesOrderBucket bucket, IMappedEntity existing, String operation,  CancellationToken cancellationToken = default, SaveBucketImportDelegate baseMethod,)

 

When i compile, it is indicating that the Optional parameter (CancellationToken) must be after the Required parameter (SaveBucketImportDelegate) - if i switch them around I get a signatures do not match error.

Not really sure what the correct syntax would be. Or perhaps a new approach to overriding the behavior in 22r2.

Thanks!

 

Hi @mgifford5 please try to remove default from the parameter

 public delegate Task SaveBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken);

I think it should work this way.


Hi @mgifford5 please try to remove default from the parameter

 public delegate Task SaveBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing, String operation, CancellationToken cancellationToken);

I think it should work this way.

That makes sense and appears to be working - will post back if anything pops up - Thanks for fast reply!!


Reply