in

Generated class TableSchema is initialized incorrectly?

Last post 05-08-2008 4:05 PM by Justin_W. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-08-2008 4:05 PM

    Generated class TableSchema is initialized incorrectly?

    It appears that the classes generated by SubCommander incorrectly initialize the class' "TableSchema.Table" instance. I noticed this because some of my Scaffold controls with AutoGenerateManyToMany=true weren't showing the ManyToMany while editing, while others were.

    After some investigation, I determined that the "TableSchema.Table" instance created and stored by the generated class for that table is different than one that is initialized via the following code:

        TableSchema.Table schema = DataService.Providers["MyDB"].GetTableSchema("MyTable", TableType.Table);

     The differences include:

    1. schema.ManyToManys.Count equals 1. In the generated schema, it is 0.

    2. schema.PrimaryKeyTables.Count equals 1. In the generated schema, it is 0.

    3. Some of the properties of the various Column objects are different. E.g. DefaultSetting is null in one, String.Empty in another. Also, Display name is empty in one, but initialized in another.

    Is there a reason that the generated class' schema is only partially initialized? I realize that I have the ability to customize the class' template, but I thought that the default templates were supposed to work out of the box. Can someone please provide some insight on this issue as to whether this is a bug or not?

    Thanks.

    Filed under:
Page 1 of 1 (1 items)