示例#1
0
        public IEnumerable<IMap> ReverseEngineer(
            DatabaseSchema schema,
            ISqlDialect sqlDialect,
            IEnumerable<string> tablesToIgnore,
            IAnswerProvider answerProvider,
            bool fixOneToOnes) {
            if (tablesToIgnore == null) {
                tablesToIgnore = new string[0];
            }

            var maps = new List<IMap>();
            this.configuration = new Configuration(sqlDialect);
            foreach (var table in schema.Tables.Where(t => !tablesToIgnore.Contains(t.Name))) {
                maps.Add(this.MapTable(table));
            }

            // go back through and add indexes and foreign keys
            foreach (var map in maps) {
                GetIndexesAndForeignKeys(schema.Tables.First(t => t.Name == map.Table), map);
            }

            // go back through and try to spot one-to-one columns
            if (fixOneToOnes) {
                foreach (var map in maps) {
                    FindOneToOnes(map, answerProvider);
                }
            }

            return maps;
        }
 public DomainModelProvider(
     ISchemaReader schemaReader, 
     IEntityInfoAdapterFactory entityInfoAdapterFactory, 
     IPropertyInfoAdapterFactory propertyInfoAdapterFactory, 
     INavigationPropertyInfoAdapterFactory navigationPropertyInfoAdapterFactory, 
     IIIdentifierGenerationServiceFactory identifierGenerationServiceFactory,
     IPluralizationService pluralizationService,
     IReverseEngineeringConfiguration configuration)
 {
     
     this.schemaReader                         = schemaReader;
     this.entityInfoAdapterFactory             = entityInfoAdapterFactory;
     this.navigationPropertyInfoAdapterFactory = navigationPropertyInfoAdapterFactory;
     this.propertyInfoAdapterFactory           = propertyInfoAdapterFactory;
     this.configuration                        = configuration;
     this.identifierGenerationService          = identifierGenerationServiceFactory.Create(pluralizationService, configuration);
 }
示例#3
0
        public IEnumerable <IMap> ReverseEngineer(
            DatabaseSchema schema,
            ISqlDialect sqlDialect,
            IEnumerable <string> tablesToIgnore,
            IAnswerProvider answerProvider,
            bool fixOneToOnes)
        {
            if (tablesToIgnore == null)
            {
                tablesToIgnore = new string[0];
            }

            var maps = new List <IMap>();

            this.configuration = new Configuration(sqlDialect);
            foreach (var table in schema.Tables.Where(t => !tablesToIgnore.Contains(t.Name)))
            {
                maps.Add(this.MapTable(table));
            }

            // go back through and add indexes and foreign keys
            foreach (var map in maps)
            {
                GetIndexesAndForeignKeys(schema.Tables.First(t => t.Name == map.Table), map);
            }

            // go back through and try to spot one-to-one columns
            if (fixOneToOnes)
            {
                foreach (var map in maps)
                {
                    FindOneToOnes(map, answerProvider);
                }
            }

            return(maps);
        }
 public IdentifierGenerationService(IPluralizationService pluralizationService, IReverseEngineeringConfiguration configuration)
 {
     this.pluralizationService = pluralizationService;
     this.configuration = configuration;
 }
 public IIdentifierGenerationService Create(IPluralizationService pluralizationService,IReverseEngineeringConfiguration configuration)
 {
     return new IdentifierGenerationService(pluralizationService, configuration);
 }