views:

75

answers:

1

Hi there,

I have a vb.net baseclass in a dll in my c# project. I created a derived class in c#. I fill the C# class with all its properties, including the base properties from the vb class.

Now I send them through a webservice (c# ) to a jQuery client. But on the client I only see the vb properties?

Anyone has a clue?

public class FilmItem : ContentItem // ContentItem is from VB DLL
{
    public string Zender { get; set; }
    public string Jaar { get; set; }

}

    [WebMethod]
    public IEnumerable GetContentItems(VBLib.GridRequest gridRequest)
    {
        ContentCache contentCache = new ContentCache();
        return contentCache.GetFilms(gridRequest); // gives back a List<FilmItem>
    }

Just found out that if I remove the vb.net class, all the properties are showing fine from the C# class. Also found out that the vb.net is declared like this:

Public Class ContentItem
Inherits System.Collections.Generic.Dictionary(Of String, Object)
Implements IContentItem

Could it be the dictionary or the interface? ( which sums up the properties I was seeing)

regards, Henk

A: 

What was the type you returned from the web service? The C# class?

Also, please show some code. I bet you've just created the C# properties wrong, and if you removed the base class and just sent the derived class, you'd get nothing sent.

John Saunders
It is not the c# class, I somehow is due to the fact that I derive it from the vb.net lass, which inherits from a Dictionary, and implements a interface that summed up the properties I did see.
Henk
Dictionaries aren't XML Serializable. Also, try returning IEnumerable<FilmItem> instead of just IEnumerable.
John Saunders
Yes, I know that. But some research showed that it were just the properties from the vb class, that were put into the dictionary. calling the webservice frmo the browser also gave me an error ( the can't serialize dictionary). But what I don't understand is why it is working when calling it from jQuery, and why am I not seeing the C# properties. Since the vb class was just a container for some properites and nothing more, I just created a new C# baseclass, old legacy code is still using the vb stuff, I am now just responsible for the C# stuff :)
Henk