mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-22 20:13:50 +08:00
- No need for IRepository<T>::void Transaction(Action action); to be in 0.8. We don't want it to be used.
--HG-- branch : dev
This commit is contained in:
@@ -20,8 +20,5 @@ namespace Orchard.Data {
|
||||
IEnumerable<T> Fetch(Expression<Func<T, bool>> predicate);
|
||||
IEnumerable<T> Fetch(Expression<Func<T, bool>> predicate, Action<Orderable<T>> order);
|
||||
IEnumerable<T> Fetch(Expression<Func<T, bool>> predicate, Action<Orderable<T>> order, int skip, int count);
|
||||
|
||||
[Obsolete]
|
||||
void Transaction(Action action);
|
||||
}
|
||||
}
|
@@ -80,22 +80,6 @@ namespace Orchard.Data {
|
||||
int count) {
|
||||
return Fetch(predicate, order, skip, count).ToReadOnlyCollection();
|
||||
}
|
||||
void IRepository<T>.Transaction(Action action) {
|
||||
Transaction(action);
|
||||
}
|
||||
|
||||
public virtual void Transaction(Action action) {
|
||||
using (var transaction = Session.BeginTransaction()) {
|
||||
try {
|
||||
action();
|
||||
transaction.Commit();
|
||||
}
|
||||
catch {
|
||||
transaction.Rollback();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
Reference in New Issue
Block a user