protected virtual ConventionSet CreateConventionSet()
        {
            var conventions = new ConventionSet();

            conventions.EntityTypeAddedConventions.Add(new PropertyDiscoveryConvention());
            conventions.EntityTypeAddedConventions.Add(new KeyDiscoveryConvention());
            conventions.EntityTypeAddedConventions.Add(new RelationshipDiscoveryConvention());

            var keyConvention = new KeyConvention();
            conventions.KeyAddedConventions.Add(keyConvention);

            conventions.ForeignKeyAddedConventions.Add(new ForeignKeyPropertyDiscoveryConvention());

            conventions.ForeignKeyRemovedConventions.Add(keyConvention);

            return conventions;
        }
        private static InternalModelBuilder CreateInternalModelBuilder()
        {
            var conventions = new ConventionSet();

            conventions.EntityTypeAddedConventions.Add(new PropertyDiscoveryConvention());
            conventions.EntityTypeAddedConventions.Add(new KeyDiscoveryConvention());

            var keyConvention = new KeyConvention();

            conventions.KeyAddedConventions.Add(keyConvention);
            conventions.ForeignKeyRemovedConventions.Add(keyConvention);

            return new InternalModelBuilder(new Model(), conventions);
        }