Why DataContext class does not have a overload constructor?

Jul 29, 2014 at 6:25 PM
The only constructor:
public DataContext(string nameOrConnectionString) : base(nameOrConnectionString)
        {
            _instanceId = Guid.NewGuid();
            Configuration.LazyLoadingEnabled = false;
            Configuration.ProxyCreationEnabled = false;
        }
But what i needed was this:
        public DataContext(DbConnection valueDbConnection, bool contextOwnsConnection)
            : base(valueDbConnection, contextOwnsConnection)
        {
            _instanceId = Guid.NewGuid();
            Configuration.LazyLoadingEnabled = false;
            Configuration.ProxyCreationEnabled = false;
        }
thats a secure approach? can i do this?
Coordinator
Aug 1, 2014 at 5:44 PM
The framework is made to be easily extensible, add a constructor to your needs is perfectly fine.
Marked as answer by lelong37 on 8/1/2014 at 10:44 AM