4
//DTO
public class SampleDto : IReturn<SampleDto>
{
public int Id { get; set; }
public string Description { get; set; }
}
public class ListSampleDto : IReturn<List<SampleDto>>
{
}
//Service
public class SampleService : Service
{
public object Get(ListSampleDto request)
{
List<SampleDto> res = new List<SampleDto>();
res.Add(new SampleDto() { Id = 1, Description = "first" });
res.Add(new SampleDto() { Id = 2, Description = "second" });
res.Add(new SampleDto() { Id = 3, Description = "third" });
return res;
}
}
//Client
string ListeningOn = ServiceStack.Configuration.ConfigUtils.GetAppSetting("ListeningOn");
JsonServiceClient jsc = new JsonServiceClient(ListeningOn);
// How to tell the service only to deliver the objects where Description inludes the letter "i"
List<SampleDto> ks = jsc.Get(new ListSampleDto());
我不知道如何從JsonServiceClient發送過濾條件(例如,只獲取描述中包含字母「i」的對象)到服務。如何使用JsonServiceClient過濾對象
謝謝,這是我錯過了(對於長時間的復活節延遲) – gerhard 2013-04-04 11:56:54