Comments (9)
Begin/Completed are very handy when you implement Unit of Work pattern. Besides, it is bad practice to introduce breaking changes. And finally, good documentation is most important thing.
from npoco.
And what is difference between BeginTransaction/CompleteTransaction and Database.GetTransaction/Transaction.Complete for unit of work pattern (as Transaction wrapper use these methods inside)?
from npoco.
Nothing. That is the whole point. Breaking changes on one hand. What is on the other hand besides nitpicking?
from npoco.
Sorry but only nitpicking and no redundancy.
from npoco.
BeginTransaction/Complete/Abort need to be there when you can't directly surround the code with a using block etc.
I don't think it is an issue.
from npoco.
But you can use Transaction wrapper without "using block":
- Database.GetTransaction = Database.BeginTransaction
- Transaction.Complete = Database.CompleteTransaction
- Transaction.Dispose = Database.AbortTransaction
It is 1-to-1 mapping + "using" if can/needed.
from npoco.
True, however then I would have to store the transaction object somewhere as well as the database object.
from npoco.
Partially true because you already have BaseTransaction property for this which not long ago was public.
from npoco.
BaseTransaction was not for this (was used to manage nested transactions). This has now as you have mentioned been made internal.
from npoco.
Related Issues (20)
- No Tracking for Inserts HOT 1
- strongly typing IDs using implicit operator?
- One To Many References not working HOT 1
- Parameters are not working HOT 5
- InsertBulkAsync<T> fails with error: Cannot change DataType of a column once it has data. HOT 1
- new questions regarding multi-tenant apps
- Dependency injection example for context HOT 1
- SqliteConnection misdetected as SqlServerConnection HOT 1
- SQLite Insert Error : SQL logic error unrecognized token: @
- Hint() with PostgreSQL
- More than 4 Multiple Result Sets Mapping - 2
- Foreign key example using fluent mapping HOT 1
- Repository-wide license? HOT 1
- Why isn't DBConcurrencyException sent to IExceptionInterceptor?" HOT 1
- NullReferenceException / InvalidOperationException on multiple calls to Async Db method HOT 2
- Map string to json/jsonb field with PostgreSQL HOT 1
- Is version column in Sql Server supposed to be populated after an update?
- IMapper.GetParameterConverter sourceType parameter Is a different type between Insert and Update HOT 1
- NPOCO Does not map Composite Primary Key HOT 1
- culture bug??
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 npoco.