locked
Can we define ODATALIB_ASYNC when building OData for .NET 3.5? RRS feed

Answers

  • Hi,

    In short no, it can't be enabled. The async support in ODL is based on the Task APIs which are only available in .NET 4.0 and higher. To tweak the sample to work on sync only platforms (like .NET 3.5) just make the message implement IODataRequestMessage (instead of IODataRequestMessageAsync) and remove the GetStreamAsync method (it's the only method added by the Async variant of the interface). The same thing go for response messages.

    I don't think the samples themselves actually use async so it should work even with the sync only interfaces.

    Thanks,


    Vitek Karas [MSFT]

    • Marked as answer by DavidThielen Wednesday, July 25, 2012 8:17 PM
    Wednesday, July 25, 2012 7:53 PM
    Moderator

All replies

  • Hi,

    In short no, it can't be enabled. The async support in ODL is based on the Task APIs which are only available in .NET 4.0 and higher. To tweak the sample to work on sync only platforms (like .NET 3.5) just make the message implement IODataRequestMessage (instead of IODataRequestMessageAsync) and remove the GetStreamAsync method (it's the only method added by the Async variant of the interface). The same thing go for response messages.

    I don't think the samples themselves actually use async so it should work even with the sync only interfaces.

    Thanks,


    Vitek Karas [MSFT]

    • Marked as answer by DavidThielen Wednesday, July 25, 2012 8:17 PM
    Wednesday, July 25, 2012 7:53 PM
    Moderator
  • There were some other .net 4.0 items in there. So we decided to use EdmxReader.TryParse as we figure it has everything we need at present and that you'll eventually have it read everything.

    thanks - dave


    Who will win The International Collegiate Programming Championships?

    Wednesday, July 25, 2012 8:19 PM