You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have a big problem on using Complex Types on my entities.
I created a small repro for my issue. You can find it as an attachment.
The VS Solution is attached so that following Package Manager command can be executed without any errors.
Add-Migration -Name Initial -Force
You can see the generated output in 201605111247310_Initial.cs.
I configured a MaxLength for all strings to 50 (see MyContext.cs).
Then I configured one of the sub property (PropB) of MyEntity.First (this is a complex type) to have a max length of 100.
Up to here all works as expected.
Now I'm trying to configure property "PropB" for MyEntity.Second to have a max length of 200.
For that uncomment line 18 in MyEntityConfiguration.cs and run the following command again:
Add-Migration -Name Initial -Force
Now I get this error:
Conflicting configuration settings were specified for property 'PropA' on type 'ComplexTypeWithStringLength.MyComplexType' MaxLength = 100 conflicts with MaxLength = 200
@IT-CASADO This is a limitation of EF, some property facets need to be stored in C-Space and EF doesn't have a way of configuring a particular usage of a complex type. So you can only specify different S-Space facets like ColumnName or ColumnType
Hi,
i have a big problem on using Complex Types on my entities.
I created a small repro for my issue. You can find it as an attachment.
The VS Solution is attached so that following Package Manager command can be executed without any errors.
Add-Migration -Name Initial -Force
You can see the generated output in 201605111247310_Initial.cs.
I configured a MaxLength for all strings to 50 (see MyContext.cs).
Then I configured one of the sub property (PropB) of MyEntity.First (this is a complex type) to have a max length of 100.
Up to here all works as expected.
Now I'm trying to configure property "PropB" for MyEntity.Second to have a max length of 200.
For that uncomment line 18 in MyEntityConfiguration.cs and run the following command again:
Add-Migration -Name Initial -Force
Now I get this error:
Conflicting configuration settings were specified for property 'PropA' on type 'ComplexTypeWithStringLength.MyComplexType' MaxLength = 100 conflicts with MaxLength = 200
I don't understand why!? Is this a bug?
Regards,
Daniel
ComplexTypeWithStringLength.zip
The text was updated successfully, but these errors were encountered: