public Task<CompositeType> GetDataUsingDataContract(CompositeType composite)
 {
     return Task.Factory.FromAsync<CompositeType>(
             (callback, state) =>
             base.Channel.BeginGetDataUsingDataContract((CompositeType)state, callback, state),
             base.Channel.EndGetDataUsingDataContract,
             composite);
 }
Beispiel #2
0
        public Task<CompositeType> GetDataUsingDataContract(CompositeType composite)
        {
            return Task.Run(
                () =>
                    {
                        if (composite == null)
                        {
                            throw new ArgumentNullException("composite");
                        }

                        if (composite.BoolValue)
                        {
                            composite.StringValue += "Suffix";
                        }

                        return composite;
                    });
        }