Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created a WCF Service having 3 methods. Each methods returns ServiceResponse class.

Public Class ServiceResponse
{
public string status {get; set;}
public string message {get; set;}
public List<reviewclass> {get; set;} // Here instead of creating List<type> for each
public List<orderclass> {get; set;} //methods I want to have a generic List<object>
type which can store List<anyclass> at run time
}

1) public ServiceResponse GetReviews()
{

List<reviewclass> lstReview = repository.GetReviews().

ServiceResponse res = new ServiceResponse()

res.status = "Success";
res.message = "Some message";
res.List<reviewclass> = lstReview; // here I want to use List<object>
returs res;
}

2) public ServiceResponse GetOrderDetails() returns List<orderclass>
{

List<orderclass> lstOrder = repository.GetOrders();

ServiceResponse res = new ServiceResponse()

res.status = &quot;Success&quot;;
res.message = &quot;Some message&quot;;
res.List<orderclass> = lstOrder ; // here I want to use List<Object>
returs res;
}

Is it possible?


Thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900