Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions WebAPI/LearningHub.Nhs.Repository/LearningHubDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public LearningHubDbContext(LearningHubDbContextOptions options)
this.options = options;
}

/// <summary>
/// Gets the Options.
/// </summary>
public LearningHubDbContextOptions Options
{
get { return this.options; }
}

/// <summary>
/// Gets or sets the Address.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ public async Task DeleteBlockCollection(int userId, int blockCollectionId)

foreach (var id in collectionIds)
{
await this.DbContext.Database.ExecuteSqlRawAsync("resources.BlockCollectionDelete @p0", new SqlParameter("@p0", SqlDbType.Int) { Value = id });
using (var lhContext = new LearningHubDbContext(this.DbContext.Options))
{
_ = lhContext.Database.ExecuteSqlRawAsync("resources.BlockCollectionDelete @p0", new SqlParameter("@p0", SqlDbType.Int) { Value = id });
}
}
}

Expand Down