Comments (7)
Can you connect to your DB at all?
The ~UnitOfWork()
is the finalizer, and it should be correct in calling dispose(false)
.
Joe Duffy has a good writeup about dispose vs finalization: http://joeduffyblog.com/2005/04/08/dg-update-dispose-finalization-and-resource-management/
from dapperunitofwork.
from dapperunitofwork.
Hi,
I can connect to the database (read and write data).
Closing my connection? Can you detail? I'm doing like this.
using (var uow = new UnitOfWork())
{
var user = uow.LoginRepository.Get(email);
}
from dapperunitofwork.
from dapperunitofwork.
I have change the constructor
`public UnitOfWork()
{
var connectionString = string.Empty;
connectionString = ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString;
_connection = new SqlConnection(connectionString);
_connection.Open();
_transaction = _connection.BeginTransaction();
_loginRepository = new LoginRepository(_transaction);
}`
from dapperunitofwork.
from dapperunitofwork.
Hi,
The connection string is correct. I can read and write data on tables.
from dapperunitofwork.
Related Issues (13)
- InvalidOperationException due to open connection when testing HOT 1
- how do rollback operation in som condition HOT 1
- Avoid the possibility of exceptions in the constructor HOT 1
- Can you create some unit tests to demonstrate how to test calls to stored procs?
- What is the license for this repository? HOT 3
- False attribution?
- Without Transaction
- RepositoryBase less accessible HOT 1
- UnitOfWork for multiple ExecuteAsync stored procedures
- Does Connection.execute trips database
- Move common DB operations in base repository
- Why do you begin transaction after dispose? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dapperunitofwork.