Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/nuget/xunit.analyzers-1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alexyakunin authored Aug 23, 2023
2 parents f02a974 + 60c48b0 commit f083b42
Show file tree
Hide file tree
Showing 214 changed files with 1,862 additions and 1,422 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Avoid shallow clone for Nerdbank.GitVersioning
fetch-depth: 0
Expand All @@ -22,11 +22,12 @@ jobs:
setCommonVars: true

- run: "echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'"
- name: Setup .NET Core
uses: actions/setup-dotnet@v1

- name: Setup .NET 8.0 Preview
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.200"
include-prerelease: true
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

- name: Install WASM tools
run: dotnet workload install wasm-tools
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Avoid shallow clone for Nerdbank.GitVersioning
fetch-depth: 0
Expand All @@ -41,18 +41,20 @@ jobs:
setCommonVars: true

- run: "echo 'SemVer2: ${{ steps.nbgv.outputs.SemVer2 }}'"
- name: Setup .NET Core
uses: actions/setup-dotnet@v1

- name: Setup .NET 8.0 Preview
uses: actions/setup-dotnet@v3
with:
dotnet-version: "6.0.x"
dotnet-version: '8.0.x'
dotnet-quality: 'preview'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<!-- Defaults for .csproj -->
<OutputType>Library</OutputType>
<LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -45,7 +45,7 @@
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
<!-- NU5048: The 'PackageIconUrl'/'iconUrl' element is deprecated -->
<!-- NU5105: The package version uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients -->
<!-- NETSDK1138: The target framework 'net5.0' is out of support. -->
<!-- NETSDK1138: The target framework 'net5.0' is out of support. -->
<NoWarn>$(NoWarn);NU5048;NU5105;NETSDK1138</NoWarn>
<WarningsAsErrors>true</WarningsAsErrors>
</PropertyGroup>
Expand Down
39 changes: 24 additions & 15 deletions Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,67 @@

<PropertyGroup>
<!-- Core packages -->
<AspNetCoreVersion>7.*</AspNetCoreVersion>
<AspNetCoreVersion>8.0.0-preview.*</AspNetCoreVersion>
<AspNetCoreVersion7>7.*</AspNetCoreVersion7>
<AspNetCoreVersion6>6.*</AspNetCoreVersion6>
<AspNetCoreVersion5>5.*</AspNetCoreVersion5>
<AspNetCoreVersion3>3.*</AspNetCoreVersion3>
<BlazorVersion>$(AspNetCoreVersion)</BlazorVersion>
<BlazorVersion7>$(AspNetCoreVersion7)</BlazorVersion7>
<BlazorVersion6>$(AspNetCoreVersion6)</BlazorVersion6>
<BlazorVersion5>$(AspNetCoreVersion5)</BlazorVersion5>
<BlazorVersion3>$(AspNetCoreVersion3)</BlazorVersion3>
<SystemXxxVersion>$(AspNetCoreVersion)</SystemXxxVersion>
<SystemXxxVersion7>$(AspNetCoreVersion7)</SystemXxxVersion7>
<SystemXxxVersion6>$(AspNetCoreVersion6)</SystemXxxVersion6>
<SystemXxxVersion5>$(AspNetCoreVersion5)</SystemXxxVersion5>
<MicrosoftExtensionsVersion>$(AspNetCoreVersion)</MicrosoftExtensionsVersion>
<MicrosoftExtensionsVersion7>$(AspNetCoreVersion7)</MicrosoftExtensionsVersion7>
<MicrosoftExtensionsVersion6>$(AspNetCoreVersion6)</MicrosoftExtensionsVersion6>
<CSharpVersion>4.4.*</CSharpVersion>
<!-- EF Core -->
<EntityFrameworkCoreVersion>7.*</EntityFrameworkCoreVersion>
<EntityFrameworkCoreVersion>$(AspNetCoreVersion7)</EntityFrameworkCoreVersion>
<EntityFrameworkCoreVersion7>$(AspNetCoreVersion7)</EntityFrameworkCoreVersion7>
<EntityFrameworkCoreVersion6>$(AspNetCoreVersion6)</EntityFrameworkCoreVersion6>
<EntityFrameworkCoreVersion5>$(AspNetCoreVersion5)</EntityFrameworkCoreVersion5>
<EntityFrameworkCoreVersion3>$(AspNetCoreVersion3)</EntityFrameworkCoreVersion3>
<EntityFrameworkCoreNpgsqlVersion>7.*</EntityFrameworkCoreNpgsqlVersion>
<EntityFrameworkCoreNpgsqlVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCoreNpgsqlVersion>
<EntityFrameworkCoreNpgsqlVersion7>$(EntityFrameworkCoreVersion7)</EntityFrameworkCoreNpgsqlVersion7>
<EntityFrameworkCoreNpgsqlVersion6>$(EntityFrameworkCoreVersion6)</EntityFrameworkCoreNpgsqlVersion6>
<EntityFrameworkCoreNpgsqlVersion5>$(EntityFrameworkCoreVersion5)</EntityFrameworkCoreNpgsqlVersion5>
<EntityFrameworkCoreNpgsqlVersion3>$(EntityFrameworkCoreVersion3)</EntityFrameworkCoreNpgsqlVersion3>
<MySqlConnectorVersion>2.2.*</MySqlConnectorVersion>
<MySqlConnectorVersion6>2.1.*</MySqlConnectorVersion6>
<MySqlConnectorVersion5>$(MySqlConnectorVersion6)</MySqlConnectorVersion5>
<MySqlConnectorVersion3>0.*</MySqlConnectorVersion3>
<EntityFrameworkCoreMySqlVersion>7.0.*</EntityFrameworkCoreMySqlVersion>
<EntityFrameworkCoreMySqlVersion6>$(AspNetCoreVersion6)</EntityFrameworkCoreMySqlVersion6>
<EntityFrameworkCoreMySqlVersion5>$(AspNetCoreVersion5)</EntityFrameworkCoreMySqlVersion5>
<EntityFrameworkCoreMySqlVersion3>$(AspNetCoreVersion3)</EntityFrameworkCoreMySqlVersion3>
<EntityFrameworkCoreMySqlVersion>$(EntityFrameworkCoreVersion)</EntityFrameworkCoreMySqlVersion>
<EntityFrameworkCoreMySqlVersion7>$(EntityFrameworkCoreVersion7)</EntityFrameworkCoreMySqlVersion7>
<EntityFrameworkCoreMySqlVersion6>$(EntityFrameworkCoreVersion6)</EntityFrameworkCoreMySqlVersion6>
<EntityFrameworkCoreMySqlVersion5>$(EntityFrameworkCoreVersion5)</EntityFrameworkCoreMySqlVersion5>
<EntityFrameworkCoreMySqlVersion3>$(EntityFrameworkCoreVersion3)</EntityFrameworkCoreMySqlVersion3>
<!-- Serialization -->
<AspNetCoreNewtonsoftJsonVersion>$(AspNetCoreVersion)</AspNetCoreNewtonsoftJsonVersion>
<AspNetCoreNewtonsoftJsonVersion7>$(AspNetCoreVersion7)</AspNetCoreNewtonsoftJsonVersion7>
<AspNetCoreNewtonsoftJsonVersion6>$(AspNetCoreVersion6)</AspNetCoreNewtonsoftJsonVersion6>
<NewtonsoftJsonVersion>13.0.*</NewtonsoftJsonVersion>
<MemoryPackVersion>1.9.*</MemoryPackVersion>
<MessagePackVersion>2.5.*</MessagePackVersion>
<!-- Other -->
<RestEaseVersion>1.6.*</RestEaseVersion>
<!-- Testing -->
<AspNetCoreMvcTestingVersion>$(AspNetCoreVersion6)</AspNetCoreMvcTestingVersion>
<AspNetCoreMvcTestingVersion>$(AspNetCoreVersion)</AspNetCoreMvcTestingVersion>
<AspNetCoreMvcTestingVersion7>$(AspNetCoreVersion7)</AspNetCoreMvcTestingVersion7>
<AspNetCoreMvcTestingVersion6>$(AspNetCoreVersion6)</AspNetCoreMvcTestingVersion6>
<AspNetCoreMvcTestingVersion5>$(AspNetCoreVersion5)</AspNetCoreMvcTestingVersion5>
<AspNetCoreMvcTestingVersion3>$(AspNetCoreVersion3)</AspNetCoreMvcTestingVersion3>
<AspNetCoreMvcTestingVersionN4>$(AspNetCoreVersion5)</AspNetCoreMvcTestingVersionN4>
<!-- Build & Samples -->
<BlazoriseVersion>1.1.*</BlazoriseVersion>
<StlFusionVersion>6.1.*</StlFusionVersion>
<StlFusionVersion>6.2.*</StlFusionVersion>
</PropertyGroup>

<ItemGroup Label="Package Versions">
<PackageReference Update="AspNet.Security.OAuth.GitHub" Version="$(AspNetCoreVersion)" />
<PackageReference Update="AspNet.Security.OAuth.GitHub" Version="$(AspNetCoreVersion7)" />
<PackageReference Update="Blazorise" Version="$(BlazoriseVersion)" />
<PackageReference Update="Blazorise.Bootstrap" Version="$(BlazoriseVersion)" />
<PackageReference Update="Blazorise.DataGrid" Version="$(BlazoriseVersion)" />
Expand All @@ -66,7 +75,6 @@
<PackageReference Update="Bullseye" Version="4.2.*" />
<PackageReference Update="CliWrap" Version="3.6.*" />
<PackageReference Update="DataAnnotationsValidatorNetStandard" Version="1.0.*" />
<PackageReference Update="EFCore.CheckConstraints" Version="$(EntityFrameworkCoreVersion)" />
<PackageReference Update="Enums.NET" Version="4.0.*" />
<PackageReference Update="MemoryPack" Version="$(MemoryPackVersion)" />
<PackageReference Update="MemoryPack.Core" Version="$(MemoryPackVersion)" />
Expand Down Expand Up @@ -122,9 +130,10 @@
<PackageReference Update="System.CommandLine.DragonFruit" Version="0.3.0-alpha.21216.1" />
<PackageReference Update="System.Diagnostics.Common" Version="$(SystemXxxVersion)" />
<PackageReference Update="System.Drawing.Common" Version="$(SystemXxxVersion)" />
<PackageReference Update="System.IO.Abstractions" Version="19.2.29" />
<PackageReference Update="System.IO.Abstractions" Version="19.2.64" />
<PackageReference Update="System.Linq.Async" Version="$(SystemXxxVersion6)" />
<PackageReference Update="System.Net.Http.Json" Version="$(SystemXxxVersion)" />
<PackageReference Update="System.Net.Http" Version="4.3.*" />
<PackageReference Update="System.Net.WebSockets" Version="4.3.*" />
<PackageReference Update="System.Net.WebSockets.Client" Version="4.3.*" />
<PackageReference Update="System.Reactive" Version="6.0.*" />
Expand Down Expand Up @@ -152,10 +161,10 @@
<PackageReference Update="ILogger.Moq" Version="1.1.*" />
<PackageReference Update="Microsoft.AspNetCore.Mvc.Testing" Version="$(AspNetCoreMvcTestingVersion)" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Update="Moq" Version="4.18.*" />
<PackageReference Update="Moq" Version="4.20.*" />
<PackageReference Update="xunit" Version="2.4.2" />
<PackageReference Update="Xunit.DependencyInjection.Logging" Version="8.1.*" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.0" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />

<!-- Build time only -->
<PackageReference Update="Stl" Version="$(StlFusionVersion)" />
Expand All @@ -169,7 +178,7 @@
<!-- Analyzers -->
<PackageReference Update="Moq.Analyzers" Version="0.0.9" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers"/>
<PackageReference Update="xunit.analyzers" Version="1.2.0" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.6.*" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.7.*" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
<PackageReference Update="Roslynator.Analyzers" Version="4.3.*" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers"/>
<PackageReference Update="Meziantou.Analyzer" Version="2.0.*" PrivateAssets="All" IncludeAssets="runtime; build; native; contentfiles; analyzers"/>

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ So what DREAM means?
marks the cached result for some specific call (e.g. `GetUser(3)`) as
*inconsistent with the ground truth*, which guarantees it will be
recomputed on the next *actual* (non-invalidating) call.
Suprisingly, invalidation is *cascading*:
The invalidation is *cascading*:
if `GetUserPic("[email protected]")` calls `GetUser(3)`, its result will be invalidated
as well in this case, and the same will happen with every other computed
result that depends on `GetUser(3)` directly or indirectly.
This means Fusion tracks dependencies between cached computation results;
the dependency graph is built and updated in the runtime, and this process
This means Fusion tracks data dependencies between cached results;
the dependency graph is built and updated in real-time, and this process
is completely transparent for the developers.
- The dependency graph can be
**[Distributed](https://en.wikipedia.org/wiki/Distributed_computing)**:
Expand Down
2 changes: 1 addition & 1 deletion Run-PerformanceTest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set DOTNET_TC_QuickJitForLoops=1

set runtime=%1
if "%runtime%"=="" (
set runtime=net7.0
set runtime=net8.0
)
dotnet run --no-launch-profile -c:Release -f:%runtime% --project tests/Stl.Fusion.Tests.PerformanceTestRunner/Stl.Fusion.Tests.PerformanceTestRunner.csproj
pause
9 changes: 8 additions & 1 deletion Stl.Fusion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{91471F20-7
docs\TaskList-AY.md = docs\TaskList-AY.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniRpcApp", "samples\MiniRpcApp\MiniRpcApp.csproj", "{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiniRpc", "samples\MiniRpc\MiniRpc.csproj", "{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiServerRpc", "samples\MultiServerRpc\MultiServerRpc.csproj", "{DDD38FE8-3105-44E6-9128-921B0713FF64}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -244,6 +246,10 @@ Global
{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E}.Release|Any CPU.Build.0 = Release|Any CPU
{DDD38FE8-3105-44E6-9128-921B0713FF64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDD38FE8-3105-44E6-9128-921B0713FF64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDD38FE8-3105-44E6-9128-921B0713FF64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDD38FE8-3105-44E6-9128-921B0713FF64}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -282,6 +288,7 @@ Global
{7D7AEA6F-94DE-4F7A-943E-3BABDF77917E} = {A50B98CF-9AA1-4622-B2AD-5E17610115A7}
{5A8530A3-E69B-4BD3-B7A7-01A916D166EB} = {A50B98CF-9AA1-4622-B2AD-5E17610115A7}
{99131CAD-DDC3-4B1A-ABB8-63E0FF32B03E} = {61E78666-E338-4F6B-8CD8-8CD5E13B7C54}
{DDD38FE8-3105-44E6-9128-921B0713FF64} = {61E78666-E338-4F6B-8CD8-8CD5E13B7C54}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B50610D6-2B28-4258-98A2-A0B486FD5907}
Expand Down
2 changes: 2 additions & 0 deletions Stl.Fusion.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multitenancy/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multitenant/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Poolable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Reprocessor/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Savepoints/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ulid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Whitelister/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
1 change: 1 addition & 0 deletions build/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ await Cli.Wrap(dotnetExePath).WithArguments(new string[] {
.Add("test")
.Add("--nologo")
.Add("--no-restore")
.Add("-p:ParallelizeTestCollections=false")
.Add("--blame")
.Add("--collect:\"XPlat Code Coverage\"")
.Add("--results-directory").Add(testOutputPath)
Expand Down
8 changes: 5 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ ignore:
- "tests"
- "samples"
- "src/**/Compatibility"
- "src/Stl.Interception/ArgumentList.cs"
- "src/Stl.Interception/ArgumentList-Generated.cs" # It's enough to cover just one generic variant, so we assume it's fully covered
- "src/Stl.Fusion.Blazor" # No tests yet - let's assume this is tested via apps
- "src/Stl.Redis" # Redis tests are there, but they don't run on GitHub
- "src/Stl.Testing"
- "src/Stl.DependencyInjection.Extras"
coverage:
precision: 2
round: down
range: "65...100"
round: nearest
range: "60...100"
status:
project:
default:
Expand Down
5 changes: 4 additions & 1 deletion samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="latest" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup>
<BaseIntermediateOutputPath>$(SolutionDir)artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath>$(SolutionDir)artifacts\samples\$(MSBuildProjectName)</OutputPath>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>preview</LangVersion>
</PropertyGroup>

</Project>
9 changes: 7 additions & 2 deletions samples/HelloCart/HelloCart.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<LangVersion>preview</LangVersion>
<AssemblyName>Samples.HelloCart</AssemblyName>
<RootNamespace>Samples.HelloCart</RootNamespace>
</PropertyGroup>
Expand All @@ -21,4 +22,8 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Stl.Generators\Stl.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="obj\project.packagespec.json" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion samples/HelloCart/v2/DbCartService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public virtual async Task Edit(EditCommand<Cart> command, CancellationToken canc
{
var dbContext = _dbHub.CreateDbContext();
await using var _ = dbContext.ConfigureAwait(false);
dbContext.EnableChangeTracking(); // Otherwise LoadAsync below won't work
dbContext.EnableChangeTracking(true); // Otherwise LoadAsync below won't work

var dbCart = await dbContext.Carts.FindAsync(DbKey.Compose(id), cancellationToken);
if (dbCart == null)
Expand Down
23 changes: 23 additions & 0 deletions samples/MiniRpc/MiniRpc.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>preview</LangVersion>
<AssemblyName>Samples.MiniRpc</AssemblyName>
<RootNamespace>Samples.MiniRpc</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MemoryPack.Generator" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Stl.Fusion.Server\Stl.Fusion.Server.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Stl.Generators\Stl.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
7 changes: 2 additions & 5 deletions samples/MiniRpcApp/Program.cs → samples/MiniRpc/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Samples.MiniRpcApp;
using Samples.MiniRpc;
using Stl.CommandR;
using Stl.Fusion;
using Stl.Fusion.Server;
Expand All @@ -12,7 +12,7 @@
await (args switch {
[ "server" ] => RunServer(),
[ "client" ] => RunClient(),
_ => RunBoth(),
_ => Task.WhenAll(RunServer(), RunClient()),
});

async Task RunServer()
Expand Down Expand Up @@ -73,6 +73,3 @@ async Task ObserveWordCount() {
WriteLine($"Word count changed: {wordCount}");
};
}

Task RunBoth()
=> Task.WhenAll(RunServer(), RunClient());
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Stl.CommandR.Configuration;
using Stl.Fusion;

namespace Samples.MiniRpcApp;
namespace Samples.MiniRpc;

public interface IChat : IComputeService
{
Expand Down
Loading

0 comments on commit f083b42

Please sign in to comment.