开发者

Get full class name from table name in nhibernate

开发者 https://www.devze.com 2023-04-12 20:34 出处:网络
Using NHibernate, and in my code, I know what the table name is e.g. \"Site\" - but I need to find out what the full class name is just by knowin开发者_如何学运维g this e.g. \"MyApp.Models.Site\"

Using NHibernate, and in my code, I know what the table name is e.g. "Site" - but I need to find out what the full class name is just by knowin开发者_如何学运维g this e.g. "MyApp.Models.Site"

I need to be able to do this programmatically. Is this possible? If so how?

I'm using FluentNHibernate if this helps.

Thanks.


i'm not sure what you're asking for, but if you want to find which entity maps table, you can use this piece of code

 configuration.ClassMappings.Where(x => x.Table.Name == "Site").First().EntityName
0

精彩评论

暂无评论...
验证码 换一张
取 消