I run my application on IIS to test if my services are working as expected. Also, I run unit tests of my other internal classes' operations.
The following is my session factory configuration:
Fluently.Configure()
.Database(MySQLConfiguration.Standard
.ConnectionString(myconnectionString)
.ShowSql()
)
.CurrentSessionContext<WcfOperationSessionContext>()
//.CurrentSessionContext("call")
.Mappings(m =>
m.FluentMappings
.AddFromAssemblyOf<DtoDifficulty>())
.BuildSessionFactory();
You can notice the commented line, with //.CurrentSessionContext("call"). When I run my service on IIS, I have to use the line above it .CurrentSessionContext< WcfOperationSessionContext >(), when I run unit tests, .CurrentSessionContext("call").
Is there a way to know which case is running and set one of those options automatically?