today i'm working on a MySQL Database, and i don't know how to Map a Byte[] to a BLOB Column...
My Table looks this way:
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 Start my Application i got instantly a Exception:
NHibernate.MappingException: Could not instantiate IType BinaryBlobType: System.MissingMethodException He says for this IType is "No Constructor defined"
I can't unterstand why it is not working, everybody told me i only has to map the CustomType()
I would appreciate each help!
Greetz, Benni