@@ -7,19 +7,19 @@ namespace SQLite.CodeFirst.Builder
77{
88 internal class CreateTableStatementBuilder : IStatementBuilder < CreateTableStatement >
99 {
10- private readonly EntityType entityType ;
10+ private readonly EntitySet entitySet ;
1111 private readonly IEnumerable < AssociationType > associationTypes ;
1212
13- public CreateTableStatementBuilder ( EntityType entityType , IEnumerable < AssociationType > associationTypes )
13+ public CreateTableStatementBuilder ( EntitySet entitySet , IEnumerable < AssociationType > associationTypes )
1414 {
15- this . entityType = entityType ;
15+ this . entitySet = entitySet ;
1616 this . associationTypes = associationTypes ;
1717 }
1818
1919 public CreateTableStatement BuildStatement ( )
2020 {
21- var simpleColumnCollection = new ColumnStatementCollectionBuilder ( entityType . Properties ) . BuildStatement ( ) ;
22- var primaryKeyStatement = new PrimaryKeyStatementBuilder ( entityType . KeyMembers ) . BuildStatement ( ) ;
21+ var simpleColumnCollection = new ColumnStatementCollectionBuilder ( entitySet . ElementType . Properties ) . BuildStatement ( ) ;
22+ var primaryKeyStatement = new PrimaryKeyStatementBuilder ( entitySet . ElementType . KeyMembers ) . BuildStatement ( ) ;
2323 var foreignKeyCollection = new ForeignKeyStatementBuilder ( associationTypes ) . BuildStatement ( ) ;
2424
2525 var columnStatements = new List < IStatement > ( ) ;
@@ -29,7 +29,7 @@ public CreateTableStatement BuildStatement()
2929
3030 return new CreateTableStatement
3131 {
32- TableName = entityType . GetTableName ( ) ,
32+ TableName = entitySet . Table ,
3333 ColumnStatementCollection = new ColumnStatementCollection ( columnStatements )
3434 } ;
3535 }
0 commit comments