Sorry for the newbies' egregious question. There is something in Asinka and Iโm waiting for what I donโt understand.
In order for the method to be asynchronous, it must wait for a return from the task / method, which is also asynchronous. Right? But at some point there should not be a task that is not asynchronous or does not expect anything?
I read tutorials like these two:
https://msdn.microsoft.com/en-us/magazine/hh456401.aspx
https://msdn.microsoft.com/en-us/library/mt674882.aspx
And I looked here a lot of other topics. But I still do not understand. I will try to give a simple example. Say I want to write a value to a column in a database:
public async Task<SimpleObject> ExecuteAsync(int rowID, string value)
{
return await WriteToDB(int rowID, string value);
}
So far so good. But here where I get lost:
public async Task<SimpleObject> WriteToDB(int rowID, string value)
{
var dataRow = context.
dataRow.SomeColumn = value
context.SaveChanges();
var simpleObject = new SimpleObject();
simpleObject.success = true;
return simpleObject;
}
public class SimpleObject
{
public bool success {get;set;}
}
VS, WriteToDB() await . , . , await WriteToDB().