.net - Set custom schema to validate Entity Framework model -


on project manage entity framework not designer metadata files compose edmx (csdl, msl , ssl). have personal naming convention namespace (example mynamespace._client) csdl file , gave troubles.

for post build check if model ok using command regex validate namespace says can't "._" , that's why i'm trying set custom schema modify regex. figure out when found post.

error 1 'namespace' attribute invalid - value 'mynamespace._client' invalid according datatype 'http://schemas.microsoft.com/ado/2009/11/edm:tnamespacename' - pattern constraint failed.

the schema name system.data.resources.csdlschema_3.xsd, add copy project , modified regex tnamespace @ line 894 this:

<xs:pattern value="[\p{l}\p{nl}][\p{l}\p{nl}\p{nd}\p{mn}\p{mc}\p{pc}\p{cf}]{0,}(\.[\p{pc}\p{l}\p{nl}][\p{l}\p{nl}\p{nd}\p{mn}\p{mc}\p{pc}\p{cf}]{0,}){0,}" /> 

so specified csdl use custom schema:

<schema namespace="mynamespace" alias="self" annotation:usestrongspatialtypes="false"     xmlns:annotation="http://schemas.microsoft.com/mycustom/edm/annotation"     xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation"     xmlns="http://schemas.microsoft.com/mycustom/edm"> <using namespace="mynamespace._client" alias="client" /> 

however seems can't change because @ end have following error:

error 5 element schema in namespace http://schemas.microsoft.com/mycustom/edm unexpected root element. expected schema in 1 of following namespaces: http://schemas.microsoft.com/ado/2006/04/edm, http://schemas.microsoft.com/ado/2007/05/edm, http://schemas.microsoft.com/ado/2008/09/edm, http://schemas.microsoft.com/ado/2009/11/edm.

question:

am doing wrong ? there workaround ? have give our naming convention ?

ps:

i copy project codegeneration , annotation schemas because csdl schema using haven't done modification

<xs:import namespace="http://schemas.microsoft.com/mycustom/edm/codegeneration" schemalocation="system.data.resources.codegenerationschema.xsd" />   <xs:import namespace="http://schemas.microsoft.com/mycustom/edm/annotation" schemalocation="system.data.resources.annotationschema.xsd" /> 


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -