Skip to content

Commit 3ae1375

Browse files
authored
Merge pull request #442 from TechnologyEnhancedLearning/Develop/Fixes/TD-3948_
Tarus release to test
2 parents c06f7bb + 9543153 commit 3ae1375

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

WebAPI/LearningHub.Nhs.Repository/LearningHubDbContext.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ public LearningHubDbContext(LearningHubDbContextOptions options)
4040
this.options = options;
4141
}
4242

43+
/// <summary>
44+
/// Gets the Options.
45+
/// </summary>
46+
public LearningHubDbContextOptions Options
47+
{
48+
get { return this.options; }
49+
}
50+
4351
/// <summary>
4452
/// Gets or sets the Address.
4553
/// </summary>

WebAPI/LearningHub.Nhs.Repository/Resources/BlockCollectionRepository.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ public async Task DeleteBlockCollection(int userId, int blockCollectionId)
8383

8484
foreach (var id in collectionIds)
8585
{
86-
await this.DbContext.Database.ExecuteSqlRawAsync("resources.BlockCollectionDelete @p0", new SqlParameter("@p0", SqlDbType.Int) { Value = id });
86+
using (var lhContext = new LearningHubDbContext(this.DbContext.Options))
87+
{
88+
_ = lhContext.Database.ExecuteSqlRawAsync("resources.BlockCollectionDelete @p0", new SqlParameter("@p0", SqlDbType.Int) { Value = id });
89+
}
8790
}
8891
}
8992

0 commit comments

Comments
 (0)