How is it possible to return some kind of list from a WCF service, this the method in my WCF service.
My interface:
[OperationContract]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "Locations")]
IList<Location> GetLocations();
public IList<Location> GetLocations()
{
Pazar.Data.Repositories.LocationRepository locRepository =
new Pazar.Data.Repositories.LocationRepository();
return locRepository.GetRootLocations().ToList<Location>();
}
and this how my GetRootLocations
looks like, It returns IQueryable
, I wonder if I can maybe return IQueryable
from my WCF service?
public IQueryable<Location> GetRootLocations()
{
IQueryable<Location> locations = GetAll().Where(p => !p.ID_Parent.HasValue).OrderBy(p => p.Sequence);
return locations;
}