Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 4683bbb

Browse files
authored
refactor: Split Data-related classes out into ServiceLayer.Common (#15)
1 parent 1fecdbd commit 4683bbb

26 files changed

+105
-41
lines changed

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ services:
7474
container_name: db-migrations
7575
build:
7676
context: .
77-
dockerfile: src/ServiceLayer.Mesh/Dockerfile.migrations
77+
dockerfile: src/ServiceLayer.Common/Dockerfile.migrations
7878
args:
7979
DatabaseConnectionString: "${DatabaseConnectionString}"
8080
depends_on:

src/ServiceLayer.Mesh/Data/DesignTimeDbContextFactory.cs renamed to src/ServiceLayer.Common/Data/DesignTimeDbContextFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Microsoft.EntityFrameworkCore;
22
using Microsoft.EntityFrameworkCore.Design;
33

4-
namespace ServiceLayer.Mesh.Data;
4+
namespace ServiceLayer.Data;
55

66
public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<ServiceLayerDbContext>
77
{

src/ServiceLayer.Mesh/Migrations/20250512113115_InitialCreate.Designer.cs renamed to src/ServiceLayer.Common/Data/Migrations/20250512113115_InitialCreate.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/ServiceLayer.Mesh/Migrations/20250512113115_InitialCreate.cs renamed to src/ServiceLayer.Common/Data/Migrations/20250512113115_InitialCreate.cs

File renamed without changes.

src/ServiceLayer.Mesh/Migrations/ServiceLayerDbContextModelSnapshot.cs renamed to src/ServiceLayer.Common/Data/Migrations/ServiceLayerDbContextModelSnapshot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Microsoft.EntityFrameworkCore.Infrastructure;
55
using Microsoft.EntityFrameworkCore.Metadata;
66
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
7-
using ServiceLayer.Mesh.Data;
7+
using ServiceLayer.Data;
88

99
#nullable disable
1010

src/ServiceLayer.Mesh/Models/MeshFile.cs renamed to src/ServiceLayer.Common/Data/Models/MeshFile.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.ComponentModel.DataAnnotations;
2-
using Microsoft.EntityFrameworkCore.Metadata.Internal;
32

4-
namespace ServiceLayer.Mesh.Models;
3+
namespace ServiceLayer.Data.Models;
54

65
public class MeshFile
76
{

src/ServiceLayer.Mesh/Models/MeshFileStatus.cs renamed to src/ServiceLayer.Common/Data/Models/MeshFileStatus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace ServiceLayer.Mesh.Models;
1+
namespace ServiceLayer.Data.Models;
22

33
public enum MeshFileStatus
44
{

src/ServiceLayer.Mesh/Models/MeshFileType.cs renamed to src/ServiceLayer.Common/Data/Models/MeshFileType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace ServiceLayer.Mesh.Models;
1+
namespace ServiceLayer.Data.Models;
22

33
public enum MeshFileType
44
{

src/ServiceLayer.Mesh/Data/ServiceLayerDbContext.cs renamed to src/ServiceLayer.Common/Data/ServiceLayerDbContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Microsoft.EntityFrameworkCore;
2-
using ServiceLayer.Mesh.Models;
2+
using ServiceLayer.Data.Models;
33

4-
namespace ServiceLayer.Mesh.Data;
4+
namespace ServiceLayer.Data;
55

66
public class ServiceLayerDbContext(DbContextOptions<ServiceLayerDbContext> options) : DbContext(options)
77
{

src/ServiceLayer.Mesh/Dockerfile.migrations renamed to src/ServiceLayer.Common/Dockerfile.migrations

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RUN git submodule update --init --recursive
1212
ARG DatabaseConnectionString
1313
ENV DatabaseConnectionString=${DatabaseConnectionString}
1414

15-
RUN dotnet restore ./src/ServiceLayer.Mesh/ServiceLayer.Mesh.csproj && \
16-
dotnet build ./src/ServiceLayer.Mesh/ServiceLayer.Mesh.csproj && \
15+
RUN dotnet restore ./src/ServiceLayer.Common/ServiceLayer.Common.csproj && \
16+
dotnet build ./src/ServiceLayer.Common/ServiceLayer.Common.csproj && \
1717
dotnet tool install dotnet-ef --tool-path /tools
1818

1919
ENV PATH="/tools:$PATH" \
@@ -24,7 +24,7 @@ ENV PATH="/tools:$PATH" \
2424
RUN mkdir -p /database && \
2525
dotnet ef migrations script \
2626
-o /database/migration.sql \
27-
--project ./src/ServiceLayer.Mesh/
27+
--project ./src/ServiceLayer.Common/
2828

2929
# Stage 2: Runtime - Apply Migration and Seed Data
3030
FROM mcr.microsoft.com/mssql-tools:v1 AS migration-env

0 commit comments

Comments
 (0)