Exemple #1
0
        public void ConfigureConventions()
        {
            var optionsBuilder = new RepositoryOptionsBuilder();

            Assert.False(optionsBuilder.IsConfigured);

            optionsBuilder.UseConventions(c =>
            {
                c.PrimaryKeysCallback = (type) => new System.Reflection.PropertyInfo[] { };
            });

            Assert.True(optionsBuilder.IsConfigured);

            Assert.NotNull(optionsBuilder.Options.Conventions);
            Assert.NotNull(optionsBuilder.Options.Conventions.PrimaryKeysCallback);
        }
Exemple #2
0
        public void ConfigureConventions()
        {
            var optionsBuilder = new RepositoryOptionsBuilder();

            Assert.False(optionsBuilder.IsConfigured);

            optionsBuilder.UseConventions(c =>
            {
                c.TableNameCallback = (type) => type.Name;
            });

            Assert.True(optionsBuilder.IsConfigured);

            Assert.NotNull(optionsBuilder.Options.Conventions);
            Assert.NotNull(optionsBuilder.Options.Conventions.TableNameCallback);
        }