Skip to content

Commit e1f17e2

Browse files
authored
Merge pull request #446 from TechnologyEnhancedLearning/RC
Merge Release Taurus to Test
2 parents 4dc7907 + 3ae1375 commit e1f17e2

File tree

6 files changed

+23
-1
lines changed

6 files changed

+23
-1
lines changed

LearningHub.Nhs.WebUI/Controllers/OpenAthensController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ public ActionResult Login(string returnUrl, bool invalidScope = false)
235235
return this.View();
236236
}
237237

238+
if (string.IsNullOrWhiteSpace(this.authConfig.ClientId) || string.IsNullOrWhiteSpace(this.Settings.LearningHubWebUiUrl))
239+
{
240+
throw new Exception("ClientId or origin are empty.");
241+
}
242+
238243
var authUri = OpenAthensOpenIdConnect.GetAuthServerUri(this.authConfig, this.Settings, returnUrl);
239244

240245
return this.Redirect(authUri.AbsoluteUri);

WebAPI/LearningHub.Nhs.Database/Tables/Resource/ExternalReference.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ REFERENCES [resources].[ResourceReference] ([Id])
2020
GO
2121

2222
ALTER TABLE [resources].[ExternalReference] CHECK CONSTRAINT [FK_ExternalReference_ResourceReference]
23+
GO
24+
CREATE NONCLUSTERED INDEX [IX_Resources_ExternalReference_ExternalReference_Deleted] ON [resources].[ExternalReference]([ExternalReference], [Deleted])
2325
GO

WebAPI/LearningHub.Nhs.Database/Tables/Resource/ScormResourceVersion.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ GO
3939

4040
ALTER TABLE [resources].[ScormResourceVersion] ADD CONSTRAINT [FK_ScormResourceVersion_EsrLinkType] FOREIGN KEY([EsrLinkTypeId])
4141
REFERENCES [resources].[EsrLinkType] ([Id])
42+
GO
43+
CREATE NONCLUSTERED INDEX [IX_Resources_ScormResourceVersion_ResourceVersionId] ON [resources].[ScormResourceVersion]([ResourceVersionId])
4244
GO

WebAPI/LearningHub.Nhs.Database/Tables/Resource/ScormResourceVersionManifest.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ GO
4040
ALTER TABLE [resources].[ScormResourceVersionManifest] ADD CONSTRAINT [FK_ScormResourceVersionManifest_ScormResourceVersion] FOREIGN KEY([ScormResourceVersionId])
4141
REFERENCES [resources].[ScormResourceVersion] ([Id])
4242
GO
43+
CREATE NONCLUSTERED INDEX [IX_Resources_ScormResourceVersionManifest_ScormResourceVersionId_ManifestURL]ON [resources].[ScormResourceVersionManifest] ([ScormResourceVersionId])INCLUDE ([ManifestURL])
44+
GO

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)