none
linq to sql dbml validation RRS feed

  • Question


  • While working on a code generator to adapt access to IQtools (great stuff: http://blogs.msdn.com/mattwar/pages/linq-links.aspx ) I tried to validate a dbml file sqlmetal was generating from a factory 2003 nwind database I converted to mssql against the standard schema published http://msdn.microsoft.com/de-de/library/bb386907.aspx (there's two urls actually, one with ./schema/. and one with ./dbml/. in the url - rest identical.)
    I am however finding attributes added by sqlmetal that are not passing validation: the Type attribute in Column, or EntityNameslace, Context Namespace or Class (see in bold, below):
    sqlmetal does produce e.g. correct cs output for l2s - so apparently does not validate the input against the schema (???).
    Am I missing anything - the latest schema file someplace? Maybe someone can give a hint - thanx ahead!!
    tb

    <?xml version="1.0" encoding="utf-8"?>
    <Database Name="northwind2003" EntityNamespace ="nsnwind" ContextNamespace ="nsnwind" Class ="Northwind2003" xmlns="http://schemas.microsoft.com/linqtosql/[dbml or mappings]/2007">
      <Table Name="dbo.Categories" Member="Categories">
        <Type Name="Categories">
          <Column Name="CategoryID" Type ="System.Int32" DbType="Int NOT NULL IDENTITY" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" />
          <Column Name="CategoryName" Type="System.String" DbType="NVarChar(15) NOT NULL" CanBeNull="false" />
          <Column Name="Description" Type="System.String" DbType="NVarChar(MAX)" CanBeNull="true" />
          <Column Name="Picture" Type="System.Data.Linq.Binary" DbType="VarBinary(MAX)" CanBeNull="true" />
          <Column Name="SSMA_TimeStamp" Type="System.Data.Linq.Binary" DbType="rowversion NOT NULL" CanBeNull="false" IsVersion="true" />
          <Association Name="Products$CategoriesProducts" Member="Products" OtherKey="CategoryID" Type="Products" DeleteRule="NO ACTION" />
        </Type>
      </Table>...snip...
    Thursday, August 13, 2009 9:24 PM

All replies