Thanks. You can directly map a Bitmap. This works:
Map(o => o.MyBitmap).Not.Nullable();
However, I cannot get it to work with the auto mapping feature.
Thanks,
Brian
On Apr 17, 9:23 am, Tuna Toksoz <[email protected]> wrote:
> Or you can use a custom user type for that puirpose.
>
> Tuna Toksöz
> Eternal sunshine of the open source mind.
>
> http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
>
> On Fri, Apr 17, 2009 at 7:22 PM, Hudson Akridge
> <[email protected]>wrote:
>
> > I don't believe you can map a bitmap directly. Look at mapping a byte[]
> > instead, that maps to a SQL column (BLOB). You can still represent the
> > property as a bitmap, but store it in the field that gets mapped as a byte[]
>
> > On Mon, Apr 13, 2009 at 10:33 PM, Brian <[email protected]> wrote:
>
> >> Hi,
>
> >> I cannot map a Bitmap with the auto mapper, but I can with standard
> >> mapping. Here is the entity:
>
> >> public class Photo
> >> {
> >> public int Id { get; set; }
> >> public Bitmap Bitmap { get; set; }
> >> }
>
> >> With standard mapping (works)...
>
> >> public class PhotoMapping : ClassMap<Photo>
> >> {
> >> public PhotoMapping()
> >> {
> >> Not.LazyLoad();
> >> Id(o => o.Id);
> >> Map(o => o.Bitmap).Not.Nullable();
> >> }
> >> }
>
> >> With automapping (fails)...
>
> >> FluentConfiguration cfg = Fluently.Configure()
> >> .Database(SQLiteConfiguration.Standard.InMemory())
> >> .Mappings(m => m.AutoMappings
> >> .Add(AutoPersistenceModel
> >> .MapEntitiesFromAssemblyOf<Photo>
> >> ()
> >> .Where(t => t.Namespace ==
> >> "MyProject.Core.Domain")));
>
> >> I receive this error:
>
> >> NHibernate.MappingException: An association from the table Photo
> >> refers to an unmapped class: System.Drawing.Bitmap
> >> at NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
> >> at NHibernate.Cfg.Configuration.SecondPassCompileForeignKeys(Table
> >> table, ISet done)
> >> at NHibernate.Cfg.Configuration.SecondPassCompile()
> >> at NHibernate.Cfg.Configuration.BuildSessionFactory()
> >> at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
> >> --- End of inner exception stack trace ---
> >> at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
> >> at FluentNHibernate.SessionSource..ctor(FluentConfiguration config)
>
> >> How can I tell the auto mapper to map Bitmaps as a property rather
> >> than a relationship?
>
> >> Thanks,
> >> Brian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---