User-1838255255 posted
Hi nambir,
According to your description, I think you want to get the table definitions from the DBML file, but i notice that the DBML file is XML file, if you wnat to read the table definitions from this XML. Like
https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/code-generation-in-linq-to-sql provide DBML file, if you want to get the following string:
<Table Name="Customers">
<Type Name="Customer">
<Column Name="CustomerID" Type="System.String" DbType="NChar(5) NOT NULL" IsPrimaryKey="True" CanBeNull="False" />
<Column Name="CompanyName" Type="System.String" DbType="NVarChar(40) NOT NULL" CanBeNull="False" />
<Column Name="ContactName" Type="System.String" DbType="NVarChar(30)" CanBeNull="True" />
<Column Name="ContactTitle" Type="System.String" DbType="NVarChar(30)" CanBeNull="True" />
<Column Name="Address" Type="System.String" DbType="NVarChar(60)" CanBeNull="True" />
<Column Name="City" Type="System.String" DbType="NVarChar(15)" CanBeNull="True" />
<Column Name="Region" Type="System.String" DbType="NVarChar(15)" CanBeNull="True" />
<Column Name="PostalCode" Type="System.String" DbType="NVarChar(10)" CanBeNull="True" />
<Column Name="Country" Type="System.String" DbType="NVarChar(15)" CanBeNull="True" />
<Column Name="Phone" Type="System.String" DbType="NVarChar(24)" CanBeNull="True" />
<Column Name="Fax" Type="System.String" DbType="NVarChar(24)" CanBeNull="True" />
<Association Name="FK_CustomerCustomerDemo_Customers" Member="CustomerCustomerDemos" ThisKey="CustomerID" OtherKey="CustomerID" OtherTable="CustomerCustomerDemo" DeleteRule="NO ACTION" />
<Association Name="FK_Orders_Customers" Member="Orders" ThisKey="CustomerID" OtherKey="CustomerID" OtherTable="Orders" DeleteRule="NO ACTION" />
</Type>
</Table>
if my understaing is right? if not, please correct me!
Best Regards,
Eric Du