I'm facing problem with 'Unrecognized Guid format.' while trying to find the data in the set. Application work with .Net 4.5 and EF6. I'm facing this issue since we switch from MsSql to MySql Db.
Entities look like:
public abstract class DomainEntity(){
public Guid Id { get; protected set; };
public bool IsActive { get; protected set; }
public DateTime CreateTime { get; set; }
public DateTime ModifyTime { get; set; }
}
The DB tables look like:
CREATE TABLE IF NOT EXISTS `MssDocumentsDb`.`dbo_Versionings` (
`Id` CHAR(36) UNIQUE NOT NULL,
`IsActive` TINYINT(1) NOT NULL DEFAULT 1,
`CreateTime` DATETIME(6) NOT NULL,
`ModifyTime` DATETIME(6) NOT NULL,
PRIMARY KEY (`Id`));
And getting most data working properly, but sometimes I'm facing the issue with 'Unrecognized Guid format.'
The places where mostly that error occurs looks like:
public virtual TEntity Get(Guid Id)
=> Id != Guid.Empty ? GetSet().Find(Id) : null;
Create set:
public IDbSet<TEntity> CreateSet<TEntity>()
where TEntity : class => base.Set<TEntity>();
I'm tried different solutions to solve this issue. Tried to switch Id in db from CHAR(36) to varchar(64), passing Id.ToSting() or adding 'Old Guids=true' to the connection string, but without results.
Thanks for any help.