I just found a bug in the new version of SchemaExplorer (3.2.4.797) at MemberColumnSchemaCollection.Contains(CoolumnSchema value) method.How to reproduce:
DB:
Code:
SqlSchemaProvider p = new SqlSchemaProvider();DatabaseSchema db = new DatabaseSchema(p, "your-connection-string");TableSchema table = db.Tables["E_AWBs"];// Returns truebool isFound = Test(table.Columns["FlightNO"]);// Returns false - in the previous version it worked just finebool isFoundTPK = Test(table.PrimaryKey.MemberColumns["FlightNO"]);public static bool Test(ColumnSchema column){ TableSchema tbl = column.Table; foreach (TableKeySchema key in tbl.ForeignKeys) { if (key.ForeignKeyMemberColumns.Contains(column)) return true; } return false;}
My opinion:
Workaround:
column = column.Table.Columns[column.Name]; // Change the pointer to address the real column
I'll open a bug(I'm not sure it's the right definition) at CodeSmith support forum.
update [06.02.2006]: Just got an answer from Eric J. Smith "This issue should be resolved for the next maintenance release."
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2009, Oren Ellenbogen
<= Contact me via E-mail
newtelligence dasBlog 2.2.8279.16125