public PathValidation(PathValueIndexer <TSource> indexer, ValidationRuleFactory <TSource> factory) { Id = Guid.NewGuid(); Indexer = indexer; Path = indexer?.PathName; Factory = factory; }
public PathValueIndexer <TSource> GetIndexer <TSource>(IPath <TSource> path) { var pathName = path.PathName(); var storageKey = $"{typeof(TSource).FullName}{c_separator}{pathName}"; var tIndexer = m_indexerStorage.GetOrAdd(storageKey, x => PathValueIndexer <TSource> .Create <TSource>(path)); return((PathValueIndexer <TSource>)tIndexer); }
/// <summary> /// Please use First() for value indexing /// </summary> public static PathValueIndexer <TSource> Create <TProperty>(IPath <TSource> path) { var result = new PathValueIndexer <TSource>(); path.PrepareForIndexing(); result.m_path = path; result.PathName = path.PathName(); return(result); }