Page 1 of 1

Max length of string field

Posted: Wed 10 Nov 2010 11:30
by damon.cognito
Entity Framework
Postgresql 8.4
Latest DevartConnect for Postgresql

Have been trying to get the maximum length of a string field. I have used the code below which correctly returns the 'item' and finds the field 'Reference' (length 16) but the "MaxLength" is always null. Same on every other field. Am I doing something wrong?

Code: Select all

MetadataWorkspace workspace = entity.MetadataWorkspace;
object value = new object();
var item = workspace.GetItems(DataSpace.CSpace).Where  
                       (i => i.Name == "TblClientHead").Single();  
value = item.Properties.Where
                       (p => p.Name == "Reference").Single().TypeUsage.Facets["MaxLength"].Value;

Posted: Thu 11 Nov 2010 16:31
by AndreyR
Thank you for the report, I have reproduced the issue.
I will let you know about the results of our investigation.

Posted: Fri 12 Nov 2010 12:40
by AndreyR
This problem is fixed in the latest Beta version of dotConnect for PostgreSQL. You can downoload this build from Registered Users' Area or the Trial version from the download page.