public static DataTable ToProfile(this TextIndexes indexes) { DataTable dt = new DataTable() { TableName = "Index Profile" }; dt.Columns.Add("Count", typeof(int)); dt.Columns.Add("Word", typeof(string)); foreach (var item in indexes.OrderByDescending(i => i.Count).ThenBy(x => x.Value)) { var r = dt.NewRow(); r[0] = item.Count; r[1] = item.Value; dt.Rows.Add(r); } return(dt); }
public static bool Load(this TextIndexes index, List <TextIndex> list) { index.AddRange(list); return(true); }