c# - How to combine two more List<> parameters? -
i have 5 different web service
list<_filta> a= new list<_filta>(); list<_filtb> b= new list<_filta>(); list<_filtc> c= new list<_filta>(); list<_filtd> d= new list<_filta>(); list<_mainfilt> main= new list<_mainfilt>();
and 4 different method , 1 [webmethod]
each list's parameters ex:
[webmethod] public list<_mainfilt> search(string p1,int p2 ...) { code here... _filta= _filta(someparameters); //go filta method _filtb= _filtb(someparameters); . . code... . . return search; //get seach values } public list<_filta> filta (someparameters) { _filta flg3 = new _filta(); codes.... flg3 = new _filta { pricelink = link, price = valuesomething, price2 = valuesomething1 }; search.add(flg3); return filta ; }
and 3 more method this.
i want combined these 4 list (_lista,_listb,_listc,_listd) in list<_mainfilt>
how can combined? or suggestion solving problem?
instead of returning list<_mainfilt>
, return object containing 4 lists of filters, e.g:
public class filters { public list<_filta> filtera {get; set;} public list<_filtb> filterb {get; set;} public list<_filtc> filterc {get; set;} public list<_filtd> filterd {get; set;} } ... [webmethod] public filters search(string p1,int p2 ...) { return new filters { filtera = _filta(someparameters), filterb = _filtb(someparameters), filterc = _filtc(someparameters), filterd = _filtd(someparameters), }; }
Comments
Post a Comment