WebAPI custom root

bjerh

New member
Joined
Apr 22, 2014
Messages
1
Programming Experience
5-10
Hi Vb.Net community. I'm looking forward to being a part of this forum, since my recently discovery. :)


I've been searching far and wide for an answer to this problem, but every time I have come to a point where I'm hitting my head against a brick wall.

I need to have my data from WebApi served in a manner so that Ember-data can use them.

The following link seems to have the right answer:
How can I add a custom root node when serializing an object with JSON.NET?

But this part isn't allowed in VisualBasic.Net:
' GET api/<controller>
<JsonObject(Title:="users")> _
Public Function GetValues() As List(Of myclassname)


The following error is returned
Attribute 'JsonObjectAttribute' cannot be applied to 'GetValues' because the attribute is not valid on this declaration type.

I suspect this to be something trivial... hoping, rather. :)
 
Top Bottom