Skip to content

Commit 422d8c4

Browse files
committed
minor changes
1 parent 9856160 commit 422d8c4

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

source/Diol/src/Diol.Share/Features/EntityFrameworks/CommandExecutingDto.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@ public class CommandExecutingDto : BaseDto
3030

3131
/// <inheritdoc/>
3232
public override string EventName => nameof(CommandExecutingDto);
33+
34+
/// <summary>
35+
/// Flag is the query is a part of a transaction.
36+
/// </summary>
37+
public bool IsTransaction { get; set; }
3338
}
3439
}

source/Diol/src/Diol.Share/Services/SqlQueryService.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,15 @@ public static string ExtractOperationNameFromQuery(string sqlQuery)
107107

108108
return string.Empty;
109109
}
110+
111+
/// <summary>
112+
/// Check if the query is a part of a transaction.
113+
/// </summary>
114+
/// <param name="sqlQuery"></param>
115+
/// <returns></returns>
116+
public static bool IsTransaction(string sqlQuery)
117+
{
118+
return sqlQuery.Contains("IMPLICIT_TRANSACTIONS");
119+
}
110120
}
111121
}

source/Diol/src/Diol.Wpf.Core/Services/LocalStore.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class LocalStore<TEntity> : IStore<TEntity>
4747
private Dictionary<string, TEntity> store = new Dictionary<string, TEntity>();
4848

4949
/// <inheritdoc/>
50-
public string Add(TEntity entity, string key)
50+
public virtual string Add(TEntity entity, string key)
5151
{
5252
if (string.IsNullOrEmpty(key))
5353
{
@@ -58,7 +58,7 @@ public string Add(TEntity entity, string key)
5858
}
5959

6060
/// <inheritdoc/>
61-
public TEntity GetItemOrDefault(string id)
61+
public virtual TEntity GetItemOrDefault(string id)
6262
{
6363
if (!string.IsNullOrEmpty(id) && this.store.ContainsKey(id))
6464
{
@@ -68,7 +68,7 @@ public TEntity GetItemOrDefault(string id)
6868
}
6969

7070
/// <inheritdoc/>
71-
public string Update(TEntity entity, string key)
71+
public virtual string Update(TEntity entity, string key)
7272
{
7373
if (this.store.ContainsKey(key))
7474
{

0 commit comments

Comments
 (0)