Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit b1ccf40

Browse files
committed
Refactoring
closes #8 closes #9 closes #10 closes #11 closes #12 closes #13 closes #14 closes #18
1 parent cf29c45 commit b1ccf40

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

src/NET6CustomLibrary/EFCore/Core/Command.cs

-56
Original file line numberDiff line numberDiff line change
@@ -33,60 +33,4 @@ public async Task DeleteAsync(TEntity entity)
3333

3434
await DbContext.SaveChangesAsync();
3535
}
36-
37-
//public async Task CreateTransactionAsync(TEntity entity)
38-
//{
39-
// using var transaction = await DbContext.Database.BeginTransactionAsync();
40-
41-
// try
42-
// {
43-
// DbContext.Set<TEntity>().Add(entity);
44-
// await DbContext.SaveChangesAsync();
45-
// DbContext.Entry(entity).State = EntityState.Detached;
46-
47-
// await transaction.CommitAsync();
48-
// }
49-
// catch (Exception)
50-
// {
51-
// await transaction.RollbackAsync();
52-
// throw;
53-
// }
54-
//}
55-
56-
//public async Task UpdateTransactionAsync(TEntity entity)
57-
//{
58-
// using var transaction = await DbContext.Database.BeginTransactionAsync();
59-
60-
// try
61-
// {
62-
// DbContext.Set<TEntity>().Update(entity);
63-
// await DbContext.SaveChangesAsync();
64-
// DbContext.Entry(entity).State = EntityState.Detached;
65-
66-
// transaction.Commit();
67-
// }
68-
// catch (Exception)
69-
// {
70-
// await transaction.RollbackAsync();
71-
// throw;
72-
// }
73-
//}
74-
75-
//public async Task DeleteTransactionAsync(TEntity entity)
76-
//{
77-
// using var transaction = await DbContext.Database.BeginTransactionAsync();
78-
79-
// try
80-
// {
81-
// DbContext.Set<TEntity>().Remove(entity);
82-
// await DbContext.SaveChangesAsync();
83-
84-
// transaction.Commit();
85-
// }
86-
// catch (Exception)
87-
// {
88-
// await transaction.RollbackAsync();
89-
// throw;
90-
// }
91-
//}
9236
}

src/NET6CustomLibrary/EFCore/Core/Interfaces/ICommand.cs

-6
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,4 @@
2222
/// <param name="entity"></param>
2323
/// <returns></returns>
2424
Task DeleteAsync(TEntity entity);
25-
26-
//Task CreateTransactionAsync(TEntity entity);
27-
28-
//Task UpdateTransactionAsync(TEntity entity);
29-
30-
//Task DeleteTransactionAsync(TEntity entity);
3125
}

0 commit comments

Comments
 (0)