Page 1 of 2
EDM .net GUID
Posted: Mon 23 Jun 2008 07:54
by pleb
Hi All,
Is there anyway to get the EDM MySQL driver to support GUID? I currently use CHAR(36) in the MySQL schema.
Regards,
Pleb
Posted: Mon 23 Jun 2008 10:53
by pleb
I see that there isn't much chance of GUID (UUID) working in your current driver. I wondering if you've ever been asked to add a connection string parameter that would toggle the conversion of CHAR(36) my favourite, CHAR(48), or BINARY(16) to a GUID type. This way you could opt in for the behaviour.
Thanks Pleb
Posted: Mon 23 Jun 2008 12:38
by Alexey.mdr
Hello,
As MySQL server doesn't support GUID type, MyDirect .NET will not provide a design-time support for it.
In the coming build you will be able to set the GUID type,
manually editing the edmx XML file.
Regards,
Alexey.
Posted: Mon 23 Jun 2008 12:46
by pleb
thanks for the reply.

I guess manual support it better than no support.
Pleb
Posted: Wed 09 Jul 2008 06:24
by AndreyR
Hello, Pleb.
The manual support of GUID is implemented in the new build.
Regards, Andrey.
Posted: Wed 09 Jul 2008 06:35
by pleb
Good to hear, and thank you.

Posted: Mon 28 Jul 2008 03:20
by pleb
First thanks for the support of Guids, as this will make switching between the corelabs MySQL entity driver and any other entity driver which supports Guids easier.
I'd just like to raise the topic of "Is there a better way"
What are you thoughts of a global configuration form where you could set conditions that would apply to type selection when reverse engineering the database - table structure.
For example
"MySQL Type char, length 36, .net type Guid"
or
"MySQL Type tiny int, length 1, .net type Bool"
or
"MySQL Type enum, .net type String"
or
"MySQL Type set, .net type String"
This way the responsibility would be handed off to the developer for mapping non straight forwards types.
Pleb
Posted: Tue 29 Jul 2008 14:39
by AndreyR
Thank you for an interesting suggestion.
But the implementation of such a feature is rather sophisticated.
We will investigate the proposition.
Posted: Wed 30 Jul 2008 00:06
by pleb
Hi Andrey,
I agree that this is rather sophisticated, though I had a little chuckle when when I thought about the implementation of an ado data provider and it's sophistication. Isn't that what you deal with everyday?
Here's me thinking out loudly,
The configuration form would reside in VS, and the mappings would store locally on the developers machine.
How do you get these mappings to work with the mysql ado.net driver and entity driver?
A custom configuration section in the app.config or web.config file? The configuration form could write out this section for the developer. A developer could write out there own configuration.
Maybe an interface or abstract class could be used. The configuration form writes out the necessary classes or a developer creates them manually. The objects are loaded into the driver, and when the driver is working out the type, you could use these objects as call backs which would give the implementation to handle the type and conversion to and from?
Ok now I see why it's sophisticated
Hmmm
What are you guys thinking?
Pleb
Posted: Thu 31 Jul 2008 11:20
by AndreyR
Our investigation is in progress. We will notify you about the results, but it will take several days.
Posted: Thu 07 Aug 2008 11:23
by AndreyR
First, sorry for delay.
The configuration form will be implemented in one of the future versions.
It will contain rules enforcible by users (for example, map tinyint(1) to System.Boolean)
But the full freedom in mapping cannot be gained to users at the moment, because in the most cases it will cause problems in runtime.
Posted: Thu 07 Aug 2008 11:46
by pleb
WOW it's sounds great. Thanks for even considering it, and more importantly thanks for accepting it.

Posted: Mon 25 Aug 2008 15:16
by nilssonm
Hi All,
It is great that a manual support for GUID's is implemented, but it seems that it is a problem using the GetObjectByKey and TryGetObjectByKey methods with the provider. I am always getting a System.NotSupportedException with "DbType Guid is not supported" in return.
Is there a solution for this problem?
Mats
Posted: Tue 26 Aug 2008 15:57
by Shalex
We can't reproduce the error.
Please provide us the script that creates tables and fills them with data, .edmx file content, and a piece of your code where the exception occurs.
We will investigate the problem and notify you about results.
Posted: Fri 29 Aug 2008 14:38
by nilssonm
Hi Shalex,
I hope you have seen my mailing of the complete project I was testing with.
Mats