Hello,
How would I change this method to be async?
public void GetValue() { var ctx = new CoinCatalogEntities(new Uri("http://localhost:54405/WcfDataService1.svc")); var query = (from c in ctx.USsingle select new USsingleResults() { CoinID = c.CoinID, Checkbox = (bool)c.Checkbox, Year = c.Year, Description = c.Description, Type = c.Type, Value = c.Value, G = c.G, VG = c.VG, F = c.F, VF = c.VF, XF = c.XF, AU = c.AU, MS60 = c.MS60, MS63 = c.MS63, MS64 = c.MS64, MS64FB = c.MS64FB, MS65 = c.MS65, MS65FB = c.MS65FB }).ToList<USsingleResults>(); Value = query; }
Thanks,
Bryan
Loading
Bryan KrossleyPosted Feb 13, 2014, 9:02 AM
Jignesh TrivediPosted Feb 12, 2014, 11:14 PM
Hi,
I think, In your code you get the context object from WCf instead of doing this get the data async from WCF
Please refer
http://msdn.microsoft.com/en-us/library/ms730059(v=vs.110).aspx
http://www.codeproject.com/Articles/91528/How-to-Call-WCF-Services-Synchronously-and-Asynchr
hope this will help you.
Bryan KrossleyPosted Feb 12, 2014, 10:15 AM
Thanks for the reply
The problem is I do not know how to format my code into one that will work with async
Shweta LodhaPosted Feb 11, 2014, 4:23 PM
static async Task
{ using (StreamReader reader = new StreamReader(file))
{ string v = await reader.ReadToEndAsync(); }
Console.WriteLine("Done"); return 1;
}