这是 DTO
public class Employee
{
public int EmployeeID { get; set; }
public string EmployeeName { get; set; }
public string EmployeeeAddress { get; set; }
}
这是响应
public class EmployeeResponse
{
public List<Employee> listofemp { get; set; }
}
这是服务堆栈服务
public class EmployeeServices:Service
{
public dbRepo<Employee> objEmploye; //Repository (which is working fine)
public EmployeeServices()
{
objEmploye = new dbRepo<Employee>();
}
public object getAll(Employee obj)
{
var objlist = new EmployeeResponse {listofemp = objEmploye.GetAll().ToList()};
return objlist.listofemp;
}
}
这是 AppHostBase 类
public class ServiceHostApp:AppHostBase
{
public ServiceHostApp()
: base("ServiceStack WebSerivces", typeof(EmployeeServices).Assembly)
{
}
public override void Configure(Funq.Container container)
{
}
}
我的问题是为什么 EmployeeServices Metod 没有显示在元数据中?我还需要做些什么吗?