Can someone help me with this? I tend to work mostly in VB, so this C# compile error is a problem:
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Microsoft.ServiceBus.Messaging;
public static class ServiceBusTaskExtensions
{
public static Task SendAsync(this TopicClient client, BrokeredMessage message)
{
return Task.Factory.FromAsync((cb, state) => client.BeginSend((BrokeredMessage)state, cb, null), client.EndSend, message);
}
}
A red underline occurs inside the .FromAsync function call and the compile error is; "Cannot convert lambda expression to type 'System.IAsyncResult' because it is not a delegate type".