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梅託德未在元數據顯示? 有什麼額外的事情我需要做?
謝謝..它的工作現在:) ServiceStack方法是基於動詞:)感謝您的幫助:) –