locked
Expose array in Custom Data service provider RRS feed

  • Question

  • Hi,

    I am writing custom data service provider and I am wondering what is best way to register property which an array:

    public class SomeEntity{

    public long Id {get; set;}

    public string Name {get; set;}

    public string[] ArrayProperty {get; set;}

     

    I am following OData Provider toolkit but I cannot find appropriate way to do it.

     

    Thanks,

    Galin


    Galin Iliev [MCSD.NET, MCPD], http://www.galcho.com
    Monday, September 13, 2010 6:27 AM

Answers

  • Hi,

    Currently the OData protocol doesn't provide support for arrays/lists/collections of primitive or complex types. So entity like the above is not possible for now. You could either store everything in one string using some kind of separator, or you can define another entity and then use one to many relationship between the entities.

    Thanks,


    Vitek Karas [MSFT]
    Wednesday, September 15, 2010 6:28 AM
    Moderator