Sorry for title, I cant find the correct one. I have more than one method that returns the same result.
returning type
public class JsonTreeView
{
public int id { get; set; }
public string text { get; set; }
public string state { get; set; }
public string @checked { get; set; }
public string attributes { get; set; }
public List<JsonTreeView> children { get; set; }
}
first method
List<JsonTreeView> FromReportTree(List<ReportTree> list)
{
}
second method
List<JsonTreeView> FromLocationTree(List<LocationTree> list)
{
}
and anothers... properties of Tree models are different. for example :
LocationTree (id, name, parent, text)
ReportTree (sno, name, parent, desc)
Is it possible to write one method for all these tree models? Any suggestion or starting point?
Thanks...