FluentNhibernate をデバッグする必要はないと思います。問題はあなたの慣習にある可能性があります。
私が理解しているように、オブジェクト Region があり、他のオブジェクト Workflow に参照されています。したがって、すべての参照リンク eq の規則を設定します。
private Action<IConventionFinder> GetConventions()
{
return c =>
{
c.Add<PrimaryKeyConvention>();
c.Add<ReferenceConvention>();
c.Add<HasManyConvention>();
c.Add<TableNameConvention>();
c.Add<PropertyNameConvention>();
};
}
の実装にこのプライベート メソッドを使用します。
public AutoPersistenceModel Generate()
参照規則は次のようになります。
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;
public class ReferenceConvention : IReferenceConvention
{
public void Apply(IManyToOneInstance instance)
{
instance.Column(Inflector.Net.Inflector.Camelize(instance.Property.Name) + "Id");
}
}
該当する場合は、マッピングをオーバーライドしていることも確認してください。
マッピングをエクスポートするユニットテストウィッチがあります。残念ながら、以下は古いバージョンです。
[Test, Ignore("Run this test only if you want to see mappings")]
public void ShouldExportMappings()
{
const string mappingPath = @"mappings";
if (!Directory.Exists(mappingPath))
Directory.CreateDirectory(mappingPath);
var sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory)
.Mappings(m =>
{
m.FluentMappings
.AddFromAssemblyOf<User>()
.ExportTo(mappingPath);
m.AutoMappings
.Add(new AutoPersistenceModelGenerator().Generate())
.ExportTo(mappingPath);
}).BuildSessionFactory();
}
最後に、本当にデバッグしたい場合は、FluentNHibernate ソースをストレージからコピーして、sln に含めます。しかし、問題はコードではなくコードにあるため、これは良い考えではありません。これは役に立ちません。時間を失うだけです。