This commit is contained in:
@@ -156,13 +156,13 @@ namespace AyaNova.Biz
|
||||
internal static async Task DeleteJobsForObjectAsync(AyaTypeId ayObj, AyContext ct)
|
||||
{
|
||||
//Get a list of all jobid's for the object passed in
|
||||
List<OpsJob> jobsForObject = GetJobsForObjectAsync(ayObj, ct).Result;
|
||||
List<OpsJob> jobsForObject = await GetJobsForObjectAsync(ayObj, ct);
|
||||
|
||||
//short circuit
|
||||
if (jobsForObject.Count == 0)
|
||||
return;
|
||||
|
||||
using (var transaction = ct.Database.BeginTransaction())
|
||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -173,7 +173,7 @@ namespace AyaNova.Biz
|
||||
|
||||
// Commit transaction if all commands succeed, transaction will auto-rollback
|
||||
// when disposed if either commands fails
|
||||
transaction.Commit();
|
||||
await transaction.CommitAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -192,14 +192,14 @@ namespace AyaNova.Biz
|
||||
/// <param name="ct"></param>
|
||||
internal static async Task DeleteJobAndLogAsync(Guid jobId, AyContext ct)
|
||||
{
|
||||
using (var transaction = ct.Database.BeginTransaction())
|
||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||
{
|
||||
try
|
||||
{
|
||||
await RemoveJobAndLogsAsync(ct, jobId);
|
||||
// Commit transaction if all commands succeed, transaction will auto-rollback
|
||||
// when disposed if either commands fails
|
||||
transaction.Commit();
|
||||
await transaction.CommitAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user