Skip to content
Merged
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
2 changes: 1 addition & 1 deletion samples/Samples.Domain/Samples.Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/Samples.Events/Samples.Events.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JKang.EventSourcing.Abstractions" Version="1.0.1" />
<PackageReference Include="JKang.EventSourcing.Abstractions" Version="1.2.0-*" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions samples/Samples.Persistence/Samples.Persistence.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JKang.EventSourcing.Abstractions" Version="1.0.1" />
<PackageReference Include="JKang.EventSourcing.Abstractions" Version="1.2.0-*" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 7 additions & 13 deletions samples/Samples.WebApp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace Samples.WebApp
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
var builder = WebApplication.CreateBuilder(args);
var startup = new Startup(builder.Configuration);
startup.ConfigureServices(builder.Services);
var app = builder.Build();
startup.Configure(app, app.Environment);
app.Run();
}

public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}
8 changes: 4 additions & 4 deletions samples/Samples.WebApp/Samples.WebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JKang.EventSourcing" Version="1.0.1" />
<PackageReference Include="JKang.EventSourcing.Persistence.EfCore" Version="1.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.1" />
<PackageReference Include="JKang.EventSourcing" Version="1.2.0-*" />
<PackageReference Include="JKang.EventSourcing.Persistence.EfCore" Version="1.2.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
23 changes: 10 additions & 13 deletions samples/Samples.WebApp/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using JKang.EventSourcing.Persistence;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Samples.Domain;
using Samples.Persistence;
using Samples.WebApp.Data;
Expand All @@ -23,15 +24,7 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});


services.AddMvc();
services.AddRazorPages();

services
.AddScoped<IGiftCardRepository, GiftCardRepository>()
Expand All @@ -54,12 +47,16 @@ public void ConfigureServices(IServiceCollection services)
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(
IApplicationBuilder app,
IEventStoreInitializer<GiftCard, Guid> eventStoreInitializer)
IWebHostEnvironment env)
{
var eventStoreInitializer = app.ApplicationServices.GetRequiredService<IEventStoreInitializer<GiftCard, Guid>>();
eventStoreInitializer.EnsureCreatedAsync().Wait();

app.UseExceptionHandler("/Error");
app.UseHsts();
if (!env.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}

app.UseHttpsRedirection();

Expand Down