Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 46 additions & 10 deletions GenericOutbox.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericOutbox", "GenericOutbox\GenericOutbox.csproj", "{19148322-4525-446A-BC29-1DCFE47B0D02}"
# Visual Studio Version 17
VisualStudioVersion = 17.5.33414.496
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenericOutbox", "GenericOutbox\GenericOutbox.csproj", "{19148322-4525-446A-BC29-1DCFE47B0D02}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericOutbox.SourceGenerator", "GenericOutbox.SourceGenerator\GenericOutbox.SourceGenerator.csproj", "{B88A9832-427A-4579-835A-857D32576CDC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenericOutbox.SourceGenerator", "GenericOutbox.SourceGenerator\GenericOutbox.SourceGenerator.csproj", "{B88A9832-427A-4579-835A-857D32576CDC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{CD00B0E8-BEF5-430C-91A0-1EA64DEF297E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test", "Test\Test.csproj", "{CD00B0E8-BEF5-430C-91A0-1EA64DEF297E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{0783F2A4-7FFE-4653-8C26-5A995B8FD3AD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonService", "Tests\PersonService\PersonService.csproj", "{BA592C11-9C03-4D72-A95A-7F6755895B55}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PersonService", "Tests\PersonService\PersonService.csproj", "{BA592C11-9C03-4D72-A95A-7F6755895B55}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolService", "Tests\SchoolService\SchoolService.csproj", "{53F45A41-85B3-4D4C-AB90-EF8C4CD91BD7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchoolService", "Tests\SchoolService\SchoolService.csproj", "{53F45A41-85B3-4D4C-AB90-EF8C4CD91BD7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestServicesCommon", "Tests\TestServicesCommon\TestServicesCommon.csproj", "{4AFFEED3-1C40-4F59-A078-AF47B97A4D62}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestServicesCommon", "Tests\TestServicesCommon\TestServicesCommon.csproj", "{4AFFEED3-1C40-4F59-A078-AF47B97A4D62}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchoolService.Client", "Tests\SchoolService.Client\SchoolService.Client.csproj", "{0263B194-E128-4A89-BB47-D4BD693C5FAD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SchoolService.Client", "Tests\SchoolService.Client\SchoolService.Client.csproj", "{0263B194-E128-4A89-BB47-D4BD693C5FAD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PersonService.Client", "Tests\PersonService.Client\PersonService.Client.csproj", "{1C4723CE-7DCF-4489-A352-17B810EA0922}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PersonService.Client", "Tests\PersonService.Client\PersonService.Client.csproj", "{1C4723CE-7DCF-4489-A352-17B810EA0922}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EndToEndTests", "Tests\EndToEndTests\EndToEndTests.csproj", "{E2514C42-EBB1-4DBE-B8C4-11F8D1A1570F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EndToEndTests", "Tests\EndToEndTests\EndToEndTests.csproj", "{E2514C42-EBB1-4DBE-B8C4-11F8D1A1570F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "Tests\IntegrationTests\IntegrationTests.csproj", "{3C3A8730-4E6D-43BC-B177-5CE5511F6040}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests", "Tests\IntegrationTests\IntegrationTests.csproj", "{3C3A8730-4E6D-43BC-B177-5CE5511F6040}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ManagementUi", "ManagementUi", "{1ED60D32-E7D5-47DC-8A93-82BC6E95DAFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericOutbox.ManagementUi", "ManagementUi\Server\GenericOutbox.ManagementUi.csproj", "{87E62056-B8F7-4DEC-A21A-081B38195CD4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericOutbox.ManagementUi.Client", "ManagementUi\Client\GenericOutbox.ManagementUi.Client.csproj", "{34E1813A-511D-4135-A032-40311A0C4C25}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericOutbox.ManagementUi.Shared", "ManagementUi\Shared\GenericOutbox.ManagementUi.Shared.csproj", "{C5C8AC24-6F8F-48D9-BB3A-5D44007AE395}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericOutbox.ManagementUi.App", "ManagementUi\GenericOutbox.ManagementUi.App\GenericOutbox.ManagementUi.App.csproj", "{DC50F210-3078-4DD3-BF79-4837D33F3AF7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -68,6 +81,25 @@ Global
{3C3A8730-4E6D-43BC-B177-5CE5511F6040}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C3A8730-4E6D-43BC-B177-5CE5511F6040}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C3A8730-4E6D-43BC-B177-5CE5511F6040}.Release|Any CPU.Build.0 = Release|Any CPU
{87E62056-B8F7-4DEC-A21A-081B38195CD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{87E62056-B8F7-4DEC-A21A-081B38195CD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87E62056-B8F7-4DEC-A21A-081B38195CD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87E62056-B8F7-4DEC-A21A-081B38195CD4}.Release|Any CPU.Build.0 = Release|Any CPU
{34E1813A-511D-4135-A032-40311A0C4C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34E1813A-511D-4135-A032-40311A0C4C25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34E1813A-511D-4135-A032-40311A0C4C25}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34E1813A-511D-4135-A032-40311A0C4C25}.Release|Any CPU.Build.0 = Release|Any CPU
{C5C8AC24-6F8F-48D9-BB3A-5D44007AE395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5C8AC24-6F8F-48D9-BB3A-5D44007AE395}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5C8AC24-6F8F-48D9-BB3A-5D44007AE395}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5C8AC24-6F8F-48D9-BB3A-5D44007AE395}.Release|Any CPU.Build.0 = Release|Any CPU
{DC50F210-3078-4DD3-BF79-4837D33F3AF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC50F210-3078-4DD3-BF79-4837D33F3AF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC50F210-3078-4DD3-BF79-4837D33F3AF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC50F210-3078-4DD3-BF79-4837D33F3AF7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BA592C11-9C03-4D72-A95A-7F6755895B55} = {0783F2A4-7FFE-4653-8C26-5A995B8FD3AD}
Expand All @@ -77,5 +109,9 @@ Global
{1C4723CE-7DCF-4489-A352-17B810EA0922} = {0783F2A4-7FFE-4653-8C26-5A995B8FD3AD}
{E2514C42-EBB1-4DBE-B8C4-11F8D1A1570F} = {0783F2A4-7FFE-4653-8C26-5A995B8FD3AD}
{3C3A8730-4E6D-43BC-B177-5CE5511F6040} = {0783F2A4-7FFE-4653-8C26-5A995B8FD3AD}
{87E62056-B8F7-4DEC-A21A-081B38195CD4} = {1ED60D32-E7D5-47DC-8A93-82BC6E95DAFC}
{34E1813A-511D-4135-A032-40311A0C4C25} = {1ED60D32-E7D5-47DC-8A93-82BC6E95DAFC}
{C5C8AC24-6F8F-48D9-BB3A-5D44007AE395} = {1ED60D32-E7D5-47DC-8A93-82BC6E95DAFC}
{DC50F210-3078-4DD3-BF79-4837D33F3AF7} = {1ED60D32-E7D5-47DC-8A93-82BC6E95DAFC}
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions ManagementUi/Client/ApiModels/OutboxEntityApiModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace GenericOutbox.ManagementUi.Client.ApiModels;

public class OutboxEntityApiModel
{
public int Id { get; set; }
public Guid? Lock { get; set; }
public int? ParentId { get; set; }
public Guid ScopeId { get; set; }
public string Action { get; set; }
public string Payload { get; set; }
public OutboxRecordStatus Status { get; set; }
public DateTime? RetryTimeoutUtc { get; set; }
public int RetriesCount { get; set; }
public DateTime CreatedUtc { get; set; }
public DateTime LastUpdatedUtc { get; set; }
public string Version { get; set; }
}
12 changes: 12 additions & 0 deletions ManagementUi/Client/ApiModels/OutboxEntityCreateApiModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace GenericOutbox.ManagementUi.Client.ApiModels;

public class OutboxEntityCreateApiModel
{
public Guid? Lock { get; set; }
public int? ParentId { get; set; }
public Guid ScopeId { get; set; }
public string Action { get; set; }
public string Payload { get; set; }
public int RetriesCount { get; set; }
public string Version { get; set; }
}
15 changes: 15 additions & 0 deletions ManagementUi/Client/ApiModels/OutboxEntityUpdateApiModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace GenericOutbox.ManagementUi.Client.ApiModels;

public class OutboxEntityUpdateApiModel
{
public int Id { get; set; }
public Guid? Lock { get; set; }
public int? ParentId { get; set; }
public Guid ScopeId { get; set; }
public string Action { get; set; }
public string Payload { get; set; }
public OutboxRecordStatus Status { get; set; }
public DateTime? RetryTimeoutUtc { get; set; }
public int RetriesCount { get; set; }
public string Version { get; set; }
}
10 changes: 10 additions & 0 deletions ManagementUi/Client/ApiModels/OutboxRecordStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace GenericOutbox.ManagementUi.Client.ApiModels;

public enum OutboxRecordStatus
{
ReadyToExecute = 0,
InProgress = 1,
WaitingForRetry = 2,
Failed = 3,
Completed = 4,
}
12 changes: 12 additions & 0 deletions ManagementUi/Client/App.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
19 changes: 19 additions & 0 deletions ManagementUi/Client/GenericOutbox.ManagementUi.Client.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<StaticWebAssetBasePath>Outbox</StaticWebAssetBasePath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\GenericOutbox.ManagementUi.Shared.csproj" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions ManagementUi/Client/Pages/Counter.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@page "/counter"

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

@code {
private int currentCount = 0;

private void IncrementCount()
{
currentCount++;
}
}
50 changes: 50 additions & 0 deletions ManagementUi/Client/Pages/FetchData.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@page "/fetchdata"
@using ManagementUi.Shared
@inject HttpClient Http

<PageTitle>Weather forecast</PageTitle>

<h1>Weather forecast</h1>

<p>This component demonstrates fetching data from the server.</p>

@if (forecasts == null)
{
<p>
<em>Loading...</em>
</p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}

@code {
private WeatherForecast[]? forecasts;

protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
}

}
49 changes: 49 additions & 0 deletions ManagementUi/Client/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@page "/"
@using GenericOutbox.ManagementUi.Client.ApiModels
@inject HttpClient Http

<PageTitle>Index</PageTitle>

<h1>Hello, world!</h1>

Welcome to your new app.
<table>
@foreach (var outboxEntity in outboxEntities)
{
if (outboxEntity == outboxEntities[0])
index = 0;

var idx = index++;

<tr>
<td>@outboxEntity.Id</td>
<td>
<InputText bind-Value="outboxEntities[idx].Action"></InputText>
</td>
<td>
<select @bind="outboxEntities[idx].Status">
<option value="@OutboxRecordStatus.ReadyToExecute">@OutboxRecordStatus.ReadyToExecute</option>
<option value="@OutboxRecordStatus.InProgress">@OutboxRecordStatus.InProgress</option>
<option value="@OutboxRecordStatus.Failed">@OutboxRecordStatus.Failed</option>
<option value="@OutboxRecordStatus.WaitingForRetry">@OutboxRecordStatus.WaitingForRetry</option>
<option value="@OutboxRecordStatus.Completed">@OutboxRecordStatus.Completed</option>
</select>
</td>
<td>
<InputText bind-Value="outboxEntities[idx].Payload"></InputText>
</td>
</tr>
}
</table>
<SurveyPrompt Title="How is Blazor working for you?"/>

@code
{
public int index;
public OutboxEntityApiModel[]? outboxEntities;

protected override async Task OnInitializedAsync()
{
outboxEntities = await Http.GetFromJsonAsync<OutboxEntityApiModel[]>("OutboxEntity");
}
}
19 changes: 19 additions & 0 deletions ManagementUi/Client/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using GenericOutbox.ManagementUi.Client;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

namespace ManagementUi.Client;

public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

await builder.Build().RunAsync();
}
}
30 changes: 30 additions & 0 deletions ManagementUi/Client/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:9936",
"sslPort": 0
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5281",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
17 changes: 17 additions & 0 deletions ManagementUi/Client/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@inherits LayoutComponentBase

<div class="page">
<div class="sidebar">
<NavMenu />
</div>

<main>
<div class="top-row px-4">
<a href="https://docs.microsoft.com/aspnet/" target="_blank">About</a>
</div>

<article class="content px-4">
@Body
</article>
</main>
</div>
Loading