This repository was archived by the owner on Apr 17, 2025. It is now read-only.
File tree 2 files changed +0
-62
lines changed
src/NET6CustomLibrary/EFCore/Core
2 files changed +0
-62
lines changed Original file line number Diff line number Diff line change @@ -33,60 +33,4 @@ public async Task DeleteAsync(TEntity entity)
33
33
34
34
await DbContext . SaveChangesAsync ( ) ;
35
35
}
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
- //}
92
36
}
Original file line number Diff line number Diff line change 22
22
/// <param name="entity"></param>
23
23
/// <returns></returns>
24
24
Task DeleteAsync ( TEntity entity ) ;
25
-
26
- //Task CreateTransactionAsync(TEntity entity);
27
-
28
- //Task UpdateTransactionAsync(TEntity entity);
29
-
30
- //Task DeleteTransactionAsync(TEntity entity);
31
25
}
You can’t perform that action at this time.
0 commit comments