c# - getting Guid from database -


something strange happend, no longer able guid type mysql database .net entity model.

a while ago created database used guid's id. created connection database entity framework , worked fine.

however lost database while ago , had create again, however, classes created entity framework model have string id, not guid used be.

what type need make id's in mysql database can following:

image.id = guid.newguid(); entitymodel.image.add(image); entitymodel.savechanges(); 

this used work fine, (obviously) error: "cannot implicitly convert type 'system.guid' 'string'"

i cannot remember how once did , wondering if people here help. did read uuid() that's not how did it. somehow i've got feeling mysql updated , somehow it's no longer possible seems odd me.

i did , saw lot of people suggesting making id's binary type in mysql , converting guid it's binary form , storing that. i'm hoping not write conversion class implicitly cast guid binary...

binary(16) should work newer connectors if use 'old guids=true', otherwise wants use char(36)


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -