You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using Luticate2.Auth.Utils.Business.Fields;
  6. namespace Luticate2.Auth.Utils.Dbo.Fields
  7. {
  8. public class LuFieldDbo
  9. {
  10. public IList<string> Parts { get; set; } = new List<string>();
  11. public static LuFieldDbo Make(IEnumerable<string> parts)
  12. {
  13. var partialFieldpath = new LuFieldDbo();
  14. return partialFieldpath.Add(parts);
  15. }
  16. public static LuFieldDbo Make(string path)
  17. {
  18. var partialFieldpath = new LuFieldDbo();
  19. return partialFieldpath.Add(path);
  20. }
  21. public static LuFieldDbo Make(LuFieldDbo path)
  22. {
  23. var partialFieldpath = new LuFieldDbo();
  24. return partialFieldpath.Add(path);
  25. }
  26. public static LuFieldDbo Make<TTypeTo>(Expression<Func<TTypeTo, object>> property)
  27. {
  28. var partialFieldpath = new LuFieldDbo();
  29. return partialFieldpath.Add(property);
  30. }
  31. public override string ToString()
  32. {
  33. return string.Join("/", Parts);
  34. }
  35. }
  36. }