I am trying to create a method in my DomainService to return a list of strings. The reason why I am doing this is because I don't want to return whole entities of information. I can create a method to return a single string, as follows:
public string GetDestinations()
{
return "Hello world";
}
This works ok from the client via a InvokeOperation<string>
call. However, when I turn the DomainService method into Ienumerable, as follows;
public IEnumerable<string> GetDestinations()
{
List<String> h = new List<string>();
h.Add("HELLO");
h.Add("WORLD");
return h;
}
And then obviously use an InvokeOperation<IEnumerable<string>>
call I get a compiler error:
Type 'String' is not a valid entity type. Entity types cannot be a primitive type or a simple type like string or Guid.
Huh? This doesn't make sense given that I can return a single string. How do I return a list of strings from my DomainService?