public WrapDbConnection(DbConnection inner, IServiceProvider serviceProvider, Action <IDbCommand, Type, IServiceProvider> onCommand, Type type) { Inner = inner; _maybeRetains = Inner.ActLike(typeof(IRetainLastInsertedId)); _serviceProvider = serviceProvider; _onCommand = onCommand; _type = type; }
public WrapDbConnection(DbConnection inner, IServiceProvider serviceProvider, Action <IDbCommand, Type, IServiceProvider> onCommand, Type type) { Inner = inner; _serviceProvider = serviceProvider; _onCommand = onCommand; _type = type; try { _maybeRetains = Inner.QuackLike <IRetainLastInsertedId>(); _maybeRetains.GetLastInsertedId(); } catch { _maybeRetains = null; } }