ADO.Net Data Service Operation: array of integers as parameter

This question represents several partnerships for .Net data services. This is the signature of the function I am trying to achieve:

/// <summary>
/// Returns Descriptions for any asset in the given assetIDs.
/// </summary>
[WebGet]
public IQueryable<Description> FindDescriptionForAssets(int[] assetIDs);

      

  • I am trying to create a custom service operation in ADO.Net Data Service that takes an array of integers as a parameter. I understand that ADO.Net Data Services cannot accept an array (or a list or other enumerables) as a parameter. It's true? Is there a way to get around this?

  • It looks like using arrays like this can be achieved with .Net RIA Services DomainService. However, I have not been able to find examples to demonstrate this. Can anyone confirm this?

+2


source to share


1 answer


RIA Services supports the transfer of an array of integers. Just test it using this service call.

[ServiceOperation]
public string SayHello(int[] input)
{
    StringBuilder strings = new StringBuilder();

    foreach (var i in input)
    {
        strings.AppendFormat("Hello {0}!", i);
    }

    return strings.ToString();
}

      



Not sure about ADO.Net data service. Perhaps the problem is with the RESTful interface.

+1


source







All Articles