Is it possible to configure NHibernate to not show the parameter names in comments, in the SQL it produces?
E.g.
WHERE s开发者_如何学编程hareclass1_.PeerGroupId in (1 /* @p0 */,8 /* @p1 */,7 /* @p2 */,10 /* @p3 */,
20 /* @p4 */,2 /* @p5 */)
It makes the SQL very unreadable.
Try setting "use_sql_comments" to false. Using Fluent NHibernate's configuration:
var factory = Fluently.Configure()
.Database(configurer)
.Mappings(m => /* etc */)
.ExposeConfiguration(configuration =>
configuration
.SetProperty(Environment.UseSqlComments, "false"))
.BuildSessionFactory();
精彩评论