views:

378

answers:

1

This question is a bit of a two parter for .Net data services. This is the function signature I'm trying to achieve:

/// <summary>
/// Returns Descriptions for any asset in the given assetIDs.
/// </summary>
[WebGet]
public IQueryable<Description> FindDescriptionForAssets(int[] assetIDs);
  1. I'm trying to create a custom service operation on a ADO.Net Data Service that takes an array of integers as a parameter. My understanding is that ADO.Net Data Services can't accept an array (or List or other enumerable) as a parameter. Is this true? Is there any way around it?

  2. It looks using arrays like this may be achievable by using the .Net RIA Services's DomainService. However, I haven't been able to find any examples demonstrating it. Can anyone confirm this?

+1  A: 

RIA Services supports passing an array of integers. Just tested it out 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 on the ADO.Net Data Service. Might be an issue because of the RESTful interface.

Bryant