Возможно ли это и возможно без сопоставления атрибутов?В настоящее время я использую BinaryFormatter со сжатием ZLib, который дал хороший импульс для десериализации (3х), но все еще немного медленный.
Edit2: настройка конфигурации
public static NHibernate.Cfg.Configuration BuildConfiguration()
{
FirebirdSql.Data.FirebirdClient.FbConnection.CreateDatabase(CONNECTION_STRING);
var cfg = new FirebirdConfiguration().ConnectionString(CONNECTION_STRING);
var configuration =
Fluently.Configure()
.Database(cfg)
.Mappings(m => m.FluentMappings.AddFromNamespaceOf<DataMap>())
.ExposeConfiguration(BuildSchema)
.ExposeConfiguration(config =>
{
config.Properties.Add("use_proxy_validator", "false"); // bugfix nhib 3.2, see issues-2011-12-01.txt
config.AppendListeners(ListenerType.PreUpdate, new IPreUpdateEventListener[] { new PreUpdateEventImpl() });
config.AppendListeners(ListenerType.PreInsert, new IPreInsertEventListener[] { new PreInsertEventImpl() });
})
.BuildConfiguration();
return configuration;
}
private static void BuildSchema(Configuration cfg)
{
new SchemaExport(cfg).Create(false, true);
}
Редактировать: воткод со всем, что не связано, удалено.
Я сомневаюсь, что это сильно поможет, так как я понятия не имею, как начать комбинировать конфигурацию nhibernate с protobuf-net (Ручная модификация источника NHibernate отсутствуетвопроса).
public static NHibernate.Cfg.Configuration DeserializeConfiguration()
{
Configuration configuration = null;
using (var file = File.Open(CONFIG_PATH, FileMode.Open))
{
configuration = new BinaryFormatter().Deserialize(file) as Configuration;
}
return configuration;
}
public static NHibernate.Cfg.Configuration SerializeConfiguration(Configuration configuration)
{
using (var file = File.Open(CONFIG_PATH, FileMode.Create))
{
new BinaryFormatter().Serialize(fs, configuration);
}
return configuration;
}