Пример #1
0
        private void EnsureContainer()
        {
            if (Container != null)
            {
                return;
            }

            Container = new Container();
            EmbixFilterFactory.ConfigureServices(Container, _addAssemblies);
            Container.Verify();
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EmbixProfile"/> class.
        /// </summary>
        /// <param name="json">The json.</param>
        /// <param name="factory">The filters factory.</param>
        /// <exception cref="ArgumentNullException">json or factory</exception>
        public EmbixProfile(string json, EmbixFilterFactory factory)
        {
            if (json == null)
            {
                throw new ArgumentNullException(nameof(json));
            }

            _documents     = new Dictionary <string, DocumentDefinition>();
            _filterFactory = factory ?? throw new ArgumentNullException(nameof(factory));

            // default token field lengths
            TokenFieldLengths = new Dictionary <string, int>
            {
                { "value", 100 },
                { "language", 5 }
            };
            OccurrenceFieldLengths = new Dictionary <string, int>();

            LoadDocuments(json);
        }