This project has moved. For the latest updates, please go here.

MetaDataException thrown when using EntityConnectionFactory.CreateTransient

Feb 15, 2013 at 1:20 AM
Hi,
First, let me thank you for the great work you are doing in meeting such a critical need. Good Job. I am attempting to use database first models with Effort. I thought I would solve the Metadata issues by using code like this
_connection = EntityConnectionFactory.CreateTransient("name=myConnect");
Hower I am getting a boatload of these exceptions:
(0,0) : error 0026: MaxLength '2147483647' is not valid. Length must be between '0' and '1073741823' for 'string' type.
I am using Visual Studio 2012 and .NET Framework 5.0.
Any help will be greatly appreciated
Coordinator
Feb 15, 2013 at 10:02 AM
This seems to be a bug, back then I copied the MaxLength value (1073741823) from the SqlClient provider manifest.

The following code is from the provider manifest of Effort.
  <Type Name="string" PrimitiveTypeKind="String">
      <FacetDescriptions>
        <MaxLength DefaultValue="1073741823" Constant="false" 
                   Minimum="0" Maximum="1073741823" />
        <Unicode DefaultValue="true" Constant="false" />
        <FixedLength DefaultValue="false" Constant="false" />
      </FacetDescriptions>
 </Type>
2147483647 is the maximum value of 32-bit signed integers, so probably the current value should be replaced with that.
Coordinator
Mar 4, 2013 at 11:42 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.