Skip to content

Commit

Permalink
Feature: Distribute DatabaseContext With Types (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
denzelst authored Oct 1, 2024
2 parents 9284e31 + 665deee commit a18fdc3
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 35 deletions.
1 change: 1 addition & 0 deletions Mortein.Tests/Fixtures/DatabaseContextFixture.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Mortein.Types;

namespace Mortein.Tests.Fixtures;

Expand Down
8 changes: 4 additions & 4 deletions Mortein.Tests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -397,17 +397,17 @@
"Amazon.Lambda.Serialization.SystemTextJson": "[2.4.1, )",
"Microsoft.AspNetCore.OpenApi": "[7.0.10, )",
"Microsoft.EntityFrameworkCore": "[8.0.8, )",
"Mortein.Types": "[0.0.1, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[8.0.4, )",
"Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime": "[8.0.4, )",
"Mortein.Types": "[1.0.0, )",
"Swashbuckle.AspNetCore": "[6.7.3, )"
}
},
"mortein.types": {
"type": "Project",
"dependencies": {
"Microsoft.EntityFrameworkCore": "[8.0.8, )",
"NodaTime": "[3.1.12, )"
"NodaTime": "[3.1.12, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[8.0.4, )",
"Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime": "[8.0.4, )"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Mortein.Types;

namespace Mortein;
namespace Mortein.Types;

/// <inheritdoc/>
public class DatabaseContext(DbContextOptions<DatabaseContext> options) : DbContext(options)
Expand Down
7 changes: 6 additions & 1 deletion Mortein.Types/Mortein.Types.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>

<Version>1.0.0</Version>
<Version>1.1.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -22,5 +22,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageReference Include="NodaTime" Version="3.1.12" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference
Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime"
Version="8.0.4"
/>
</ItemGroup>
</Project>
56 changes: 56 additions & 0 deletions Mortein.Types/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@
"System.Runtime.CompilerServices.Unsafe": "4.7.1"
}
},
"Npgsql.EntityFrameworkCore.PostgreSQL": {
"type": "Direct",
"requested": "[8.0.4, )",
"resolved": "8.0.4",
"contentHash": "/hHd9MqTRVDgIpsToCcxMDxZqla0HAQACiITkq1+L9J2hmHKV6lBAPlauF+dlNSfHpus7rrljWx4nAanKD6qAw==",
"dependencies": {
"Microsoft.EntityFrameworkCore": "8.0.4",
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.4",
"Microsoft.EntityFrameworkCore.Relational": "8.0.4",
"Npgsql": "8.0.3"
}
},
"Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime": {
"type": "Direct",
"requested": "[8.0.4, )",
"resolved": "8.0.4",
"contentHash": "IJqmyj4BkqbCAm1MDZEwaUuxzYVbhtqghfkP2B9u089uCQgOtdcGbJYQwN2dyxO1ze16VDhTLUZwiq7Us1jdvg==",
"dependencies": {
"Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.4",
"Npgsql.NodaTime": "8.0.3"
}
},
"Microsoft.EntityFrameworkCore.Abstractions": {
"type": "Transitive",
"resolved": "8.0.8",
Expand All @@ -33,6 +55,15 @@
"resolved": "8.0.8",
"contentHash": "OlAXMU+VQgLz5y5/SBkLvAa9VeiR3dlJqgIebEEH2M2NGA3evm68/Tv7SLWmSxwnEAtA3nmDEZF2pacK6eXh4Q=="
},
"Microsoft.EntityFrameworkCore.Relational": {
"type": "Transitive",
"resolved": "8.0.4",
"contentHash": "aWLT6e9a8oMzXgF0YQpYYa3mDeU+yb2UQSQ+RrIgyGgSpzPfSKgpA7v2kOVDuZr2AQ6NNAlWPaBG7wZuKQI96w==",
"dependencies": {
"Microsoft.EntityFrameworkCore": "8.0.4",
"Microsoft.Extensions.Configuration.Abstractions": "8.0.0"
}
},
"Microsoft.Extensions.Caching.Abstractions": {
"type": "Transitive",
"resolved": "8.0.0",
Expand All @@ -53,6 +84,14 @@
"Microsoft.Extensions.Primitives": "8.0.0"
}
},
"Microsoft.Extensions.Configuration.Abstractions": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "3lE/iLSutpgX1CC0NOW70FJoGARRHbyKmG7dc0klnUZ9Dd9hS6N/POPWhKhMLCEuNN5nXEY5agmlFtH562vqhQ==",
"dependencies": {
"Microsoft.Extensions.Primitives": "8.0.0"
}
},
"Microsoft.Extensions.DependencyInjection": {
"type": "Transitive",
"resolved": "8.0.0",
Expand Down Expand Up @@ -98,6 +137,23 @@
"resolved": "8.0.0",
"contentHash": "bXJEZrW9ny8vjMF1JV253WeLhpEVzFo1lyaZu1vQ4ZxWUlVvknZ/+ftFgVheLubb4eZPSwwxBeqS1JkCOjxd8g=="
},
"Npgsql": {
"type": "Transitive",
"resolved": "8.0.3",
"contentHash": "6WEmzsQJCZAlUG1pThKg/RmeF6V+I0DmBBBE/8YzpRtEzhyZzKcK7ulMANDm5CkxrALBEC8H+5plxHWtIL7xnA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "8.0.0"
}
},
"Npgsql.NodaTime": {
"type": "Transitive",
"resolved": "8.0.3",
"contentHash": "C0TzQcc4+/6jpRGb/YxphmCwRwSuWde9Yz9GWap1xfX2m6/QkYBhluv/EjsPCTWq3/UZaP9UgiUZKscTLNZt4g==",
"dependencies": {
"NodaTime": "3.1.9",
"Npgsql": "8.0.3"
}
},
"System.Runtime.CompilerServices.Unsafe": {
"type": "Transitive",
"resolved": "4.7.1",
Expand Down
5 changes: 0 additions & 5 deletions Mortein/Mortein.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
<PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.1" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference
Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime"
Version="8.0.4"
/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions Mortein/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.OpenApi.Models;
using Mortein.Types;
using System.Reflection;

namespace Mortein;
Expand Down
46 changes: 23 additions & 23 deletions Mortein/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,6 @@
"Microsoft.Extensions.Logging": "8.0.0"
}
},
"Npgsql.EntityFrameworkCore.PostgreSQL": {
"type": "Direct",
"requested": "[8.0.4, )",
"resolved": "8.0.4",
"contentHash": "/hHd9MqTRVDgIpsToCcxMDxZqla0HAQACiITkq1+L9J2hmHKV6lBAPlauF+dlNSfHpus7rrljWx4nAanKD6qAw==",
"dependencies": {
"Microsoft.EntityFrameworkCore": "8.0.4",
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.4",
"Microsoft.EntityFrameworkCore.Relational": "8.0.4",
"Npgsql": "8.0.3"
}
},
"Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime": {
"type": "Direct",
"requested": "[8.0.4, )",
"resolved": "8.0.4",
"contentHash": "IJqmyj4BkqbCAm1MDZEwaUuxzYVbhtqghfkP2B9u089uCQgOtdcGbJYQwN2dyxO1ze16VDhTLUZwiq7Us1jdvg==",
"dependencies": {
"Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.4",
"Npgsql.NodaTime": "8.0.3"
}
},
"Swashbuckle.AspNetCore": {
"type": "Direct",
"requested": "[6.7.3, )",
Expand Down Expand Up @@ -224,6 +202,26 @@
"Microsoft.Extensions.Logging.Abstractions": "8.0.0"
}
},
"Npgsql.EntityFrameworkCore.PostgreSQL": {
"type": "Transitive",
"resolved": "8.0.4",
"contentHash": "/hHd9MqTRVDgIpsToCcxMDxZqla0HAQACiITkq1+L9J2hmHKV6lBAPlauF+dlNSfHpus7rrljWx4nAanKD6qAw==",
"dependencies": {
"Microsoft.EntityFrameworkCore": "8.0.4",
"Microsoft.EntityFrameworkCore.Abstractions": "8.0.4",
"Microsoft.EntityFrameworkCore.Relational": "8.0.4",
"Npgsql": "8.0.3"
}
},
"Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime": {
"type": "Transitive",
"resolved": "8.0.4",
"contentHash": "IJqmyj4BkqbCAm1MDZEwaUuxzYVbhtqghfkP2B9u089uCQgOtdcGbJYQwN2dyxO1ze16VDhTLUZwiq7Us1jdvg==",
"dependencies": {
"Npgsql.EntityFrameworkCore.PostgreSQL": "8.0.4",
"Npgsql.NodaTime": "8.0.3"
}
},
"Npgsql.NodaTime": {
"type": "Transitive",
"resolved": "8.0.3",
Expand Down Expand Up @@ -263,7 +261,9 @@
"type": "Project",
"dependencies": {
"Microsoft.EntityFrameworkCore": "[8.0.8, )",
"NodaTime": "[3.1.12, )"
"NodaTime": "[3.1.12, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[8.0.4, )",
"Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime": "[8.0.4, )"
}
}
}
Expand Down

0 comments on commit a18fdc3

Please sign in to comment.