3

I'm trying to save my administrator class object to DynamoDB using Context.SaveAsync method:

// Save admin to DynamoDB.
context.SaveAsync(admin,(result)=>{
  if (result.Exception == null)
  { 
    Console.WriteLine("admin saved");
  }
});

but it keeps bothering me with following error:

cannot convert `lambda expression' to non-delegate type `system.threading.cancellationtoken'

How do I handle this issue ?. I'm using Xamarin Studio for OS X

1 Answer 1

3

According to the documentation, DynamoDBContext.SaveAsync takes a type T, and a CancellationToken. It does not take any form of delegate type, at all.

What you want is to do is:

public async Task SaveAsync<T>(T entity, CancellationToken ct)
{
     await context.SaveAsync<T>(entity, ct);
     Console.WriteLine("entity saved");
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.