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
精彩评论