BaseViewModel.cs 722 B

12345678910111213141516171819202122232425262728
  1. 
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace Ropin.Inspection.Model
  5. {
  6. public class BaseViewModel
  7. {
  8. public List<Option> GetInspectionContentoptions(string content)
  9. {
  10. if (content != null && content.Contains("0/0.1/"))
  11. {
  12. List<string> g = content.Split('(')[1].TrimStart('(').TrimEnd(')').Split('/').ToList();
  13. return (from c in g select new Option { name = c, value = c }).ToList<Option>();
  14. }
  15. else
  16. {
  17. return null;
  18. }
  19. }
  20. }
  21. public class Option
  22. {
  23. public string name { get; set; }
  24. public string value { get; set; }
  25. }
  26. }