开发者

ADO.Net Data Service Operation: Array of integers as a parameter

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开发者_JAVA技巧 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜