Today I am working on a MySQL database and I do not know how to match byte [] in the BLOB column ...
My table is as follows:
CREATE TABLE `images` ( `Id` INT NOT NULL AUTO_INCREMENT , `imgText` VARCHAR(45) NULL , `image` BLOB NULL , PRIMARY KEY (`Id`) );
Mapping:
public class imagesMap : ClassMap<images> { public imagesMap() { Id(x => x.Id); Map(x => x.imgText); Map(x => x.image).CustomType<BinaryBlobType>(); } }
Buisnessobject:
public class images { public virtual int Id{get;set;} public virtual string imgText{get;set;} public virtual Byte[] image{get;set;} }
If I run the application, I instantly got an exception:
NHibernate.MappingException: Failed to instantiate IType BinaryBlobType: System.MissingMethodException It says that for this IType is "No Constructor defined"
I can’t understand why it doesn’t work, everyone told me that I need to display CustomType ()
I would be grateful for every help!
Greetz, Benni
Benni source share