FLuentNhibernate + Automapping
-
12-11-2019 - |
Pergunta
Anyone that can helt me with FluentNhibernate and automapping?
Check PotentialReasons collection, and InnerException for more detail. ----> FluentNHibernate.Cfg.FluentConfigurationException : An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail. ----> FluentNHibernate.Visitors.ValidationException : The entity 'NHibernateSessionManager' doesn't have an Id mapped. Use the Id method to map your identity property. For example: Id(x => x.Id).
i´m trying to automap from my classes and here is the code:
FluentConfiguration config = Fluently.Configure()
.Database(MySQLConfiguration.Standard
.ConnectionString(c => c
.Server("127.0.0.1")
.Database("db")
.Username("root")
.Password("pass")));
_sessionFactory = config.Mappings(
m => m.AutoMappings.Add(AutoMap.AssemblyOf<Product>())
.ExportTo(@"c:\hbm\"))
.BuildSessionFactory();
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow