@@ -94,6 +94,7 @@ public DataSession(DbTransaction transaction, bool disposeConnection = false, ID
9494 /// <summary>
9595 /// Initializes a new instance of the <see cref="DataSession" /> class.
9696 /// </summary>
97+ /// <param name="dataConfiguration">The configuration for the session</param>
9798 /// <exception cref="ArgumentNullException"><paramref name="dataConfiguration"/> is null</exception>
9899 public DataSession ( IDataConfiguration dataConfiguration )
99100 {
@@ -287,3 +288,52 @@ protected override void DisposeManagedResources()
287288 Connection . Dispose ( ) ;
288289 }
289290}
291+
292+ /// <summary>
293+ /// A fluent class for a data session by discriminator. Used to register multiple instances of IDataSession.
294+ /// </summary>
295+ /// <typeparam name="TDiscriminator">The type of the discriminator.</typeparam>
296+ /// <seealso cref="FluentCommand.DisposableBase" />
297+ /// <seealso cref="FluentCommand.IDataSession" />
298+ public class DataSession < TDiscriminator > : DataSession , IDataSession < TDiscriminator >
299+ {
300+ /// <summary>
301+ /// Initializes a new instance of the <see cref="DataSession" /> class.
302+ /// </summary>
303+ /// <param name="connection">The DbConnection to use for the session.</param>
304+ /// <param name="disposeConnection">if set to <c>true</c> dispose connection with this session.</param>
305+ /// <param name="cache">The <see cref="IDataCache" /> used to cached results of queries.</param>
306+ /// <param name="queryGenerator">The query generator provider.</param>
307+ /// <param name="logger">The logger delegate for writing log messages.</param>
308+ /// <exception cref="ArgumentNullException"><paramref name="connection" /> is null</exception>
309+ /// <exception cref="ArgumentException">Invalid connection string on <paramref name="connection" /> instance.</exception>
310+ public DataSession ( DbConnection connection , bool disposeConnection = true , IDataCache cache = null , IQueryGenerator queryGenerator = null , IDataQueryLogger logger = null )
311+ : base ( connection , disposeConnection , cache , queryGenerator , logger )
312+ {
313+ }
314+
315+ /// <summary>
316+ /// Initializes a new instance of the <see cref="DataSession"/> class.
317+ /// </summary>
318+ /// <param name="transaction">The DbTransaction to use for the session.</param>
319+ /// <param name="disposeConnection">if set to <c>true</c> dispose connection with this session.</param>
320+ /// <param name="cache">The <see cref="IDataCache" /> used to cached results of queries.</param>
321+ /// <param name="queryGenerator">The query generator provider.</param>
322+ /// <param name="logger">The logger delegate for writing log messages.</param>
323+ /// <exception cref="ArgumentNullException"><paramref name="transaction" /> is null</exception>
324+ /// <exception cref="ArgumentException">Invalid connection string on <paramref name="transaction" /> instance.</exception>
325+ public DataSession ( DbTransaction transaction , bool disposeConnection = false , IDataCache cache = null , IQueryGenerator queryGenerator = null , IDataQueryLogger logger = null )
326+ : base ( transaction , disposeConnection , cache , queryGenerator , logger )
327+ {
328+ }
329+
330+ /// <summary>
331+ /// Initializes a new instance of the <see cref="DataSession" /> class.
332+ /// </summary>
333+ /// <param name="dataConfiguration">The configuration for the session</param>
334+ /// <exception cref="ArgumentNullException"><paramref name="dataConfiguration" /> is null</exception>
335+ public DataSession ( IDataConfiguration < TDiscriminator > dataConfiguration )
336+ : base ( dataConfiguration )
337+ {
338+ }
339+ }
0 commit comments