Skip to content

Commit d5531ab

Browse files
committed
gh-235 Rename Sqlite to EntityFramework
Signed-off-by: Victor Chang <[email protected]>
1 parent 0ba1a4f commit d5531ab

34 files changed

+39
-42
lines changed

.licenserc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ header:
3030
- 'src/.sonarlint/**'
3131
- 'src/coverlet.runsettings'
3232
- 'src/Monai.Deploy.InformaticsGateway.sln'
33-
- 'src/Database/Migrations/**'
33+
- 'src/Database/EntityFramework/Migrations/**'
3434
- 'demos/**/.env/**'
3535
- 'demos/**/*.txt'
3636
- 'doc/dependency_decisions.yml'

src/Database/DatabaseManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
using Microsoft.Extensions.DependencyInjection;
2020
using Monai.Deploy.InformaticsGateway.Configuration;
2121
using Monai.Deploy.InformaticsGateway.Database.Api;
22-
using Monai.Deploy.InformaticsGateway.Database.Sqlite;
23-
using Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations;
22+
using Monai.Deploy.InformaticsGateway.Database.EntityFramework;
23+
using Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations;
2424

2525
namespace Monai.Deploy.InformaticsGateway.Database
2626
{
@@ -38,7 +38,8 @@ public static IServiceCollection ConfigureDatabase(this IServiceCollection servi
3838
switch (databaseType)
3939
{
4040
case "Sqlite":
41-
services.AddScoped<IDatabaseMigrationManager, SqliteDatabaseMigrationManager>();
41+
services.AddScoped<IDatabaseMigrationManager, EfDatabaseMigrationManager>();
42+
services.AddScoped(typeof(IInformaticsGatewayRepository<>), typeof(InformaticsGatewayRepository<>));
4243
services.AddDbContext<InformaticsGatewayContext>(
4344
options => options.UseSqlite(connectionStringConfigurationSection[SR.DatabaseConnectionStringKey]),
4445
ServiceLifetime.Transient);

src/Database/Sqlite/Configurations/DestinationApplicationEntityConfiguration.cs renamed to src/Database/EntityFramework/Configuration/DestinationApplicationEntityConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Microsoft.EntityFrameworkCore.Metadata.Builders;
2020
using Monai.Deploy.InformaticsGateway.Api;
2121

22-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations
22+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations
2323
{
2424
internal class DestinationApplicationEntityConfiguration : IEntityTypeConfiguration<DestinationApplicationEntity>
2525
{

src/Database/Sqlite/Configurations/InferenceRequestConfiguration.cs renamed to src/Database/EntityFramework/Configuration/InferenceRequestConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using Microsoft.EntityFrameworkCore.Metadata.Builders;
2626
using Monai.Deploy.InformaticsGateway.Api.Rest;
2727

28-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations
28+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations
2929
{
3030
internal class InferenceRequestConfiguration : IEntityTypeConfiguration<InferenceRequest>
3131
{

src/Database/Sqlite/Configurations/MonaiApplicationEntityConfiguration.cs renamed to src/Database/EntityFramework/Configuration/MonaiApplicationEntityConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
using Microsoft.EntityFrameworkCore.Metadata.Builders;
2626
using Monai.Deploy.InformaticsGateway.Api;
2727

28-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations
28+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations
2929
{
3030
internal class MonaiApplicationEntityConfiguration : IEntityTypeConfiguration<MonaiApplicationEntity>
3131
{

src/Database/Sqlite/Configurations/PayloadConfiguration.cs renamed to src/Database/EntityFramework/Configuration/PayloadConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
using Microsoft.EntityFrameworkCore.Metadata.Builders;
2525
using Monai.Deploy.InformaticsGateway.Api.Storage;
2626

27-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations
27+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations
2828
{
2929
internal class PayloadConfiguration : IEntityTypeConfiguration<Payload>
3030
{

src/Database/Sqlite/Configurations/SR.cs renamed to src/Database/EntityFramework/Configuration/SR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations
18+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations
1919
{
2020
public static class SR
2121
{

src/Database/Sqlite/Configurations/SourceApplicationEntityConfiguration.cs renamed to src/Database/EntityFramework/Configuration/SourceApplicationEntityConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
using Microsoft.EntityFrameworkCore;
1919
using Monai.Deploy.InformaticsGateway.Api;
2020

21-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations
21+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations
2222
{
2323
internal class SourceApplicationEntityConfiguration : IEntityTypeConfiguration<SourceApplicationEntity>
2424
{

src/Database/Sqlite/Configurations/StorageMetadataWrapperEntityConfiguration.cs renamed to src/Database/EntityFramework/Configuration/StorageMetadataWrapperEntityConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Microsoft.EntityFrameworkCore.Metadata.Builders;
2020
using Monai.Deploy.InformaticsGateway.Database.Api;
2121

22-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations
22+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations
2323
{
2424
internal class StorageMetadataWrapperEntityConfiguration : IEntityTypeConfiguration<StorageMetadataWrapper>
2525
{

src/Database/Sqlite/SqliteDatabaseMigrationManager.cs renamed to src/Database/EntityFramework/EfDatabaseMigrationManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
using Microsoft.Extensions.Logging;
2121
using Monai.Deploy.InformaticsGateway.Database.Api;
2222

23-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite
23+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework
2424
{
25-
public class SqliteDatabaseMigrationManager : IDatabaseMigrationManager
25+
public class EfDatabaseMigrationManager : IDatabaseMigrationManager
2626
{
2727
public IHost Migrate(IHost host)
2828
{

src/Database/Sqlite/InformaticsGatewayContext.cs renamed to src/Database/EntityFramework/InformaticsGatewayContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
using Microsoft.EntityFrameworkCore.Diagnostics;
1919
using Microsoft.Extensions.Logging;
2020
using Monai.Deploy.InformaticsGateway.Api;
21-
using Monai.Deploy.InformaticsGateway.Database.Sqlite.Configurations;
21+
using Monai.Deploy.InformaticsGateway.Database.EntityFramework.Configurations;
2222

23-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite
23+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework
2424
{
2525
public class InformaticsGatewayContext : DbContext
2626
{

src/Database/Sqlite/InformaticsGatewayContextFactory.cs renamed to src/Database/EntityFramework/InformaticsGatewayContextFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
using Microsoft.EntityFrameworkCore.Design;
2020
using Microsoft.Extensions.Configuration;
2121

22-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite
22+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework
2323
{
2424
/// <summary>
2525
/// Used to EF migration.

src/Database/Sqlite/InformaticsGatewayRepository.cs renamed to src/Database/EntityFramework/InformaticsGatewayRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
using Microsoft.Extensions.DependencyInjection;
2121
using Monai.Deploy.InformaticsGateway.Database.Api;
2222

23-
namespace Monai.Deploy.InformaticsGateway.Database.Sqlite
23+
namespace Monai.Deploy.InformaticsGateway.Database.EntityFramework
2424
{
2525
public class InformaticsGatewayRepository<T> : IDisposable, IInformaticsGatewayRepository<T> where T : class
2626
{

src/Database/Sqlite/Migrations/20220203222116_R1_Initialize.Designer.cs renamed to src/Database/EntityFramework/Migrations/20220203222116_R1_Initialize.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Sqlite/Migrations/20220211175051_R1_Patch.Designer.cs renamed to src/Database/EntityFramework/Migrations/20220211175051_R1_Patch.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Sqlite/Migrations/20220613235333_R2_0.2.0.Designer.cs renamed to src/Database/EntityFramework/Migrations/20220613235333_R2_0.2.0.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Sqlite/Migrations/20220802200605_R3_0.3.0.Designer.cs renamed to src/Database/EntityFramework/Migrations/20220802200605_R3_0.3.0.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Sqlite/Migrations/20221010184458_R3_0.3.2.Designer.cs renamed to src/Database/EntityFramework/Migrations/20221010184458_R3_0.3.2.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Sqlite/Migrations/InformaticsGatewayContextModelSnapshot.cs renamed to src/Database/EntityFramework/Migrations/InformaticsGatewayContextModelSnapshot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.EntityFrameworkCore;
44
using Microsoft.EntityFrameworkCore.Infrastructure;
55
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
6-
using Monai.Deploy.InformaticsGateway.Database.Sqlite;
6+
using Monai.Deploy.InformaticsGateway.Database.EntityFramework;
77

88
#nullable disable
99

src/Database/Sqlite/Monai.Deploy.InformaticsGateway.Database.Sqlite.csproj renamed to src/Database/EntityFramework/Monai.Deploy.InformaticsGateway.Database.EntityFramework.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<!--
22
~ Copyright 2021-2022 MONAI Consortium
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +17,7 @@
1717
<Project Sdk="Microsoft.NET.Sdk">
1818

1919
<PropertyGroup>
20-
<RootNamespace>Monai.Deploy.InformaticsGateway.Database.Sqlite</RootNamespace>
20+
<RootNamespace>Monai.Deploy.InformaticsGateway.Database.EntityFramework</RootNamespace>
2121
<TargetFramework>net6.0</TargetFramework>
2222
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
2323
<ImplicitUsings>enable</ImplicitUsings>
@@ -51,6 +51,5 @@
5151
<ProjectReference Include="..\..\Api\Monai.Deploy.InformaticsGateway.Api.csproj" />
5252
<ProjectReference Include="..\..\Configuration\Monai.Deploy.InformaticsGateway.Configuration.csproj" />
5353
<ProjectReference Include="..\Api\Monai.Deploy.InformaticsGateway.Database.Api.csproj" />
54-
<ProjectReference Include="..\Repositories\Monai.Deploy.InformaticsGateway.Database.Api.csproj" />
5554
</ItemGroup>
5655
</Project>

src/Database/Monai.Deploy.InformaticsGateway.Database.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
<ProjectReference Include="..\Api\Monai.Deploy.InformaticsGateway.Api.csproj" />
2828
<ProjectReference Include="..\Configuration\Monai.Deploy.InformaticsGateway.Configuration.csproj" />
2929
<ProjectReference Include="Api\Monai.Deploy.InformaticsGateway.Database.Api.csproj" />
30-
<ProjectReference Include="Sqlite\Monai.Deploy.InformaticsGateway.Database.Sqlite.csproj" />
30+
<ProjectReference Include="EntityFramework\Monai.Deploy.InformaticsGateway.Database.EntityFramework.csproj" />
3131
</ItemGroup>
3232

3333
<ItemGroup>
34-
<Compile Remove="Sqlite\**" />
35-
<EmbeddedResource Remove="Sqlite\**" />
36-
<None Remove="Sqlite\**" />
34+
<Compile Remove="EntityFramework\**" />
35+
<EmbeddedResource Remove="EntityFramework\**" />
36+
<None Remove="EntityFramework\**" />
3737
</ItemGroup>
3838

3939
<ItemGroup>

src/InformaticsGateway/Monai.Deploy.InformaticsGateway.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--
1+
<!--
22
~ Copyright 2022 MONAI Consortium
33
~
44
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -77,8 +77,8 @@
7777
<ProjectReference Include="..\Api\Monai.Deploy.InformaticsGateway.Api.csproj" />
7878
<ProjectReference Include="..\Common\Monai.Deploy.InformaticsGateway.Common.csproj" />
7979
<ProjectReference Include="..\Configuration\Monai.Deploy.InformaticsGateway.Configuration.csproj" />
80+
<ProjectReference Include="..\Database\EntityFramework\Monai.Deploy.InformaticsGateway.Database.EntityFramework.csproj" />
8081
<ProjectReference Include="..\Database\Monai.Deploy.InformaticsGateway.Database.csproj" />
81-
<ProjectReference Include="..\Database\Sqlite\Monai.Deploy.InformaticsGateway.Database.Sqlite.csproj" />
8282
<ProjectReference Include="..\DicomWebClient\Monai.Deploy.InformaticsGateway.DicomWeb.Client.csproj" />
8383
</ItemGroup>
8484

src/InformaticsGateway/Program.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
using Monai.Deploy.InformaticsGateway.Common;
3030
using Monai.Deploy.InformaticsGateway.Configuration;
3131
using Monai.Deploy.InformaticsGateway.Database;
32-
using Monai.Deploy.InformaticsGateway.Database.Api;
33-
using Monai.Deploy.InformaticsGateway.Database.Sqlite;
3432
using Monai.Deploy.InformaticsGateway.Repositories;
3533
using Monai.Deploy.InformaticsGateway.Services.Common;
3634
using Monai.Deploy.InformaticsGateway.Services.Connectors;
@@ -112,7 +110,6 @@ internal static IHostBuilder CreateHostBuilder(string[] args) =>
112110
services.AddTransient<IStreamsWriter, StreamsWriter>();
113111
services.AddTransient<IApplicationEntityHandler, ApplicationEntityHandler>();
114112

115-
services.AddScoped(typeof(IInformaticsGatewayRepository<>), typeof(InformaticsGatewayRepository<>));
116113
services.AddScoped<IStorageMetadataWrapperRepository, StorageMetadataWrapperRepository>();
117114
services.AddScoped<IInferenceRequestRepository, InferenceRequestRepository>();
118115
services.AddScoped<IPayloadMoveActionHandler, PayloadMoveActionHandler>();

src/InformaticsGateway/Services/Http/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
using Microsoft.Extensions.DependencyInjection;
2929
using Microsoft.Extensions.Hosting;
3030
using Microsoft.OpenApi.Models;
31-
using Monai.Deploy.InformaticsGateway.Database.Sqlite;
31+
using Monai.Deploy.InformaticsGateway.Database.EntityFramework;
3232
using Monai.Deploy.InformaticsGateway.Services.Fhir;
3333

3434
namespace Monai.Deploy.InformaticsGateway.Services.Http

src/InformaticsGateway/Test/Monai.Deploy.InformaticsGateway.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
<ItemGroup>
5353
<ProjectReference Include="..\..\Api\Monai.Deploy.InformaticsGateway.Api.csproj" />
54-
<ProjectReference Include="..\..\Database\Sqlite\Monai.Deploy.InformaticsGateway.Database.Sqlite.csproj" />
54+
<ProjectReference Include="..\..\Database\EntityFramework\Monai.Deploy.InformaticsGateway.Database.EntityFramework.csproj" />
5555
<ProjectReference Include="..\Monai.Deploy.InformaticsGateway.csproj" />
5656
</ItemGroup>
5757

src/InformaticsGateway/Test/Repositories/InformaticsGatewayRepositoryTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
using Microsoft.EntityFrameworkCore;
2222
using Microsoft.Extensions.DependencyInjection;
2323
using Monai.Deploy.InformaticsGateway.Api;
24-
using Monai.Deploy.InformaticsGateway.Database.Sqlite;
25-
using Monai.Deploy.InformaticsGateway.Repositories;
24+
using Monai.Deploy.InformaticsGateway.Database.EntityFramework;
2625
using Moq;
2726
using xRetry;
2827
using Xunit;

src/Monai.Deploy.InformaticsGateway.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGat
4242
EndProject
4343
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGateway.DicomWeb.Client.CLI", "DicomWebClient\CLI\Monai.Deploy.InformaticsGateway.DicomWeb.Client.CLI.csproj", "{689E0066-81DA-4602-B058-D93389DF5DBD}"
4444
EndProject
45-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGateway.Database.Sqlite", "Database\Sqlite\Monai.Deploy.InformaticsGateway.Database.Sqlite.csproj", "{313B68CE-A0DB-4DE2-8359-AC777F5997FE}"
45+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGateway.Database.EntityFramework", "Database\EntityFramework\Monai.Deploy.InformaticsGateway.Database.EntityFramework.csproj", "{313B68CE-A0DB-4DE2-8359-AC777F5997FE}"
4646
EndProject
4747
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Monai.Deploy.InformaticsGateway.Database.Api", "Database\Api\Monai.Deploy.InformaticsGateway.Database.Api.csproj", "{366CA24C-B546-46AD-8607-AABE4F0F4864}"
4848
EndProject

tests/Integration.Test/Hooks/SqlHooks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
using Microsoft.EntityFrameworkCore;
1818
using Monai.Deploy.InformaticsGateway.Api.Rest;
19-
using Monai.Deploy.InformaticsGateway.Database.Sqlite;
19+
using Monai.Deploy.InformaticsGateway.Database.EntityFramework;
2020
using Monai.Deploy.InformaticsGateway.Integration.Test.Drivers;
2121
using Monai.Deploy.InformaticsGateway.Integration.Test.StepDefinitions;
2222
using TechTalk.SpecFlow.Infrastructure;

tests/Integration.Test/Monai.Deploy.InformaticsGateway.Integration.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@
6262
<ProjectReference Include="..\..\src\Api\Monai.Deploy.InformaticsGateway.Api.csproj" />
6363
<ProjectReference Include="..\..\src\Client\Monai.Deploy.InformaticsGateway.Client.csproj" />
6464
<ProjectReference Include="..\..\src\Configuration\Monai.Deploy.InformaticsGateway.Configuration.csproj" />
65+
<ProjectReference Include="..\..\src\Database\EntityFramework\Monai.Deploy.InformaticsGateway.Database.EntityFramework.csproj" />
6566
<ProjectReference Include="..\..\src\Database\Monai.Deploy.InformaticsGateway.Database.csproj" />
66-
<ProjectReference Include="..\..\src\Database\Sqlite\Monai.Deploy.InformaticsGateway.Database.Sqlite.csproj" />
67+
<ProjectReference Include="..\..\src\Database\Sqlite\Monai.Deploy.InformaticsGateway.Database.EntityFramework.csproj" />
6768
<ProjectReference Include="..\..\src\DicomWebClient\Monai.Deploy.InformaticsGateway.DicomWeb.Client.csproj" />
6869
</ItemGroup>
6970

0 commit comments

Comments
 (0)