Hi All,
Let me try to explain my challenge. I'm building a Silverlight app which will be using a WCF service.
The WCF service returns a list of users and roles (and lots more but trying to keep it simple).
In the SL app I need to fill several comboboxes with lists of users and roles. Usually I would use an interface to specify the key and value pair and could simply bind these to the combobox
But alas WCF doesn't provide interfaces just dataclasses. What would be a nice solution to get what I want.
I started out with a GetList method but its missing some magic. Or maybe use a 'generic' class with key/value and write a OperionContract which returns these...
Do I make any sense and what would you do?
public class Users
{
public string Name { get; set; }
public int Id { get; set; }
//Etc lastname, password
}
public class Roles
{
public string Name { get; set; }
public int Id { get; set; }
//Etc icon, superuser, whatnot
}
public class Pager
{
public static List<KeyValuePair<string, int>> GetList(List<object> itemlist)
{
var result = new List<KeyValuePair<string, int>>();
//Do some magic
return result;
}
EDIT Using an abstract class helps a bit. Until I need more 'interfaces'..