Пример #1
0
        protected override ByPropertyAliasParticleGenerator <FilterableOne> GetGenerator()
        {
            var generator = new ByPropertyAliasParticleGenerator <FilterableOne>();

            generator.Add("Filterable", typeof(FilterableOne).GetProperty(nameof(FilterableOne.Filterable)));

            generator.Add("NonFilterable", typeof(FilterableOne).GetProperty(nameof(FilterableOne.NonFilterable)));
            generator.Remove("NonFilterable");
            return(generator);
        }
Пример #2
0
        public void AliasDuplicationThrows()
        {
            var generator = new ByPropertyAliasParticleGenerator <FilterableOne>();

            generator.Add("Filterable", typeof(FilterableOne).GetProperty(nameof(FilterableOne.Filterable)));

            Assert.Throws <Exception>(() =>
            {
                generator.Add("Filterable", typeof(FilterableOne).GetProperty(nameof(FilterableOne.Filterable)));
            });
        }