Exemplo n.º 1
0
 public static List <Guid> GetProfileMockGuids(this CataloguePath path)
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     if (!path.Any())
     {
         throw new ArgumentException("Items is empty", nameof(path));
     }
     if (!(path.Last() is IProfile))
     {
         throw new ArgumentException($"Path's last element is not an {nameof(IProfile)}", nameof(path));
     }
     return(path.GetProfileMockPath().Select(x => x.Id.Value).ToList());
 }
Exemplo n.º 2
0
 public static string GetEntryId(this CataloguePath path)
 {
     if (path == null)
     {
         throw new ArgumentNullException(nameof(path));
     }
     if (!path.Any())
     {
         throw new ArgumentException("Items is empty", nameof(path));
     }
     if (!(path.Last() is IEntry))
     {
         throw new ArgumentException($"Path's last element is not an {nameof(IEntry)}", nameof(path));
     }
     return(path.GetEntryPath().Select(x => x.Id.RawValue).ToList().CombineLinkedId());
 }