Search Results

Search found 1 results on 1 pages for 'gooftroop'.

Page 1/1 | 1 

  • Cannot await 'Model.PersonalInfo'

    - by Gooftroop
    I have the following method in a DesignDataService class public async Task<T> GetData<T>(T dataObject) { var typeName = typeof(T).Name; switch (typeName) { case "PersonalInfo": var person = new PersonalInfo { FirstName = "Mickey", LastName = "Mouse" , Adres = new Address{Country="DLRP"} , }; return await person; } // end Switch } // GetData<T> How can I return a new PersonalInfo class from the DataService? For now I get the error Cannot await 'Model.PersonalInfo' Even when I change the return statement as follows return await person as Task; the error stays the same Thanks in advanced Danny

    Read the article

1