Fixed endpoints for /users and /messages.

This commit is contained in:
2025-07-05 10:22:45 +02:00
parent 070ccd79fd
commit 468d029ed5
11 changed files with 303 additions and 8 deletions

View File

@ -0,0 +1,12 @@
using Microsoft.EntityFrameworkCore.Design;
namespace MessengerBroker.Db.Sql.Migrator
{
public partial class DesignTimeDbContextFactory : IDesignTimeDbContextFactory<BrokerSqlDbContext>
{
public BrokerSqlDbContext CreateDbContext(string[] args)
{
return new BrokerSqlDbContext(CONNECTION_STRING);
}
}
}

View File

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MessengerBroker.Db.Sql\MessengerBroker.Db.Sql.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
namespace MessengerBroker.Db.Sql.Migrator
{
internal class Program
{
static void Main(string[] args)
{
// Add-Migration Initial -Project MessengerBroker.Db.Sql -StartupProject MessengerBroker.Db.Sql.Migrator -Verbose -Context BrokerSqlDbContext
// Update-Database -Project MessengerBroker.Db.Sql -StartupProject MessengerBroker.Db.Sql.Migrator -Verbose -Context BrokerSqlDbContext
}
}
}