NHibernate.Mapping.Attributes - Add methods to HbmSerializer returning a stream

Description

System.IO.MemoryStream Serialize(System.Reflection.Assembly assembly)
System.IO.MemoryStream Serialize(System.Type type)

So you can write:
cfg.AddInputStream( HbmSerializer.Default.Serialize(typeof(XXX)) )
and
cfg.AddInputStream( HbmSerializer.Default.Serialize(typeof(XXX).Assembly) )

Environment

None

Activity

Show:

Pierre Henri Kuaté June 24, 2006 at 9:08 AM

Note: HbmSerializer.Default.Serialize(typeof(XXX)) creates a MemoryStream; so if you directly pass it to cfg.AddInputStream(), it will only be closed when garbage collected...
This should be ok as you shouldn't use NHMA in production (you should generate and save xml mapping when you no longer update it and then use this file when building the session factory).

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created June 24, 2006 at 8:32 AM
Updated July 9, 2008 at 11:54 PM
Resolved June 24, 2006 at 9:08 AM
Who's Looking?