Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public List<string> Filter1 { get; set; }
  2. public List<string> Filter2 { get; set; }
  3. ...
  4. public List<string> Filter13 { get; set; }
  5.  
  6. public string Data1 { get; set; }
  7. public string Data2 { get; set; }
  8. ...
  9. public string Data13 { get; set; }
  10.  
  11. if (filter.Filter1 != null && filter.Filter1.Any()) {
  12. data = data.Where(x => filter.Filter1.Contains(x.Data1));
  13. }
  14. ...
  15. if (filter.Filter13 != null && filter.Filter13.Any()) {
  16. data = data.Where(x => filter.Filter13.Contains(x.Data13));
  17. }
  18.  
  19. private static const int N = 13;
  20.  
  21. public string[] Data = new string[N];
  22. public List<string>[] Filter = new List<string>[N];
  23. //------------------------------------------------------------------------------
  24. for(int i = 0; i < N; i++)
  25. {
  26. if(filter.Filter[i] != null && filter.Filter[i].Any()) {
  27. data = data.Where(x => filter.Filter[i].Contains(x.Data[i]));
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement