My database have column MyId which is INT PK.
In mapping file I have line
Id(x => x.Id, "MyId").GeneratedBy.GuidComb();
I know this are two different types, guid and int but my question is:
Is it possible to to keep MyId as INT in my database and dynamicly convert this record to GUID on server level. For example if I want to retreive fetch my request and convert int as guid.
Is this possible ?
You can’t convert a 4 byte signed integer into a 16 byte binary value.
You can do it the other ways and generate an int from a GUID using CHECKSUM but you will get collisions (birthday problem) eventually
Not quite sure why you want to change your key this way. Do you have GUID as the clustered PK?