I have a class that I use to list in lists from my database. All tables in the database have their own class with their own properties, and they all come from DatabaseTableRow.
public class DatabaseLinkRowsEnumerator<T> : IEnumerator<T>, IEnumerable<T> where T : DatabaseTableRow
I have a User class that comes from a page that comes from DatabaseTableRow. Then I have a property that returns DatabaseLinkRowsEnumerator, a list of users.
I also have a user interface function that displays lists of any page in a horizontal list with an image, name and link.
protected string GetVerticalListModuleHtml(IEnumerable<Page> pages)
Now all I want to do is pass the value that I have DatabaseLinkRowsEnumerator for this function. The user is logged out of the page, and DatabaseLinkRowsEnumerator is IEnumerator. Even when I try to start, I get the following error:
Unable to cast object of type 'Database.DatabaseLinkRowsEnumerator`1[Database.User]' to type 'System.Collections.Generic.IEnumerable`1[Database.Page]'.
I am using ASP.NET 2.0. Does anyone have any ideas on how to cast / convert this without making a whole copy of each?
source share