Ejemplo n.º 1
0
 public PathValidation(PathValueIndexer <TSource> indexer, ValidationRuleFactory <TSource> factory)
 {
     Id      = Guid.NewGuid();
     Indexer = indexer;
     Path    = indexer?.PathName;
     Factory = factory;
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        /// <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);
        }