diff --git a/src/Sample/Common/Product.cs b/src/Sample/Common/Product.cs index 18ba1e5..6eec2d4 100644 --- a/src/Sample/Common/Product.cs +++ b/src/Sample/Common/Product.cs @@ -1,4 +1,6 @@ -namespace Sample; +using StructId; + +namespace Sample; public record Product(ProductId Id, string Name); diff --git a/src/Sample/ConsoleDb/Program.cs b/src/Sample/ConsoleDb/Program.cs index a50b83e..34ff773 100644 --- a/src/Sample/ConsoleDb/Program.cs +++ b/src/Sample/ConsoleDb/Program.cs @@ -1,6 +1,6 @@ -using ConsoleDb; -using Dapper; +using Dapper; using Microsoft.Data.Sqlite; +using StructId; SQLitePCL.Batteries.Init(); diff --git a/src/Sample/Directory.Build.props b/src/Sample/Directory.Build.props new file mode 100644 index 0000000..adc22b9 --- /dev/null +++ b/src/Sample/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + false + true + + + diff --git a/src/Sample/Directory.Build.targets b/src/Sample/Directory.Build.targets new file mode 100644 index 0000000..1b4e8e2 --- /dev/null +++ b/src/Sample/Directory.Build.targets @@ -0,0 +1,36 @@ + + + + + $(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)..\StructId.Package\StructId.targets + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Sample/MinimalApi/MinimalApi.csproj b/src/Sample/MinimalApi/MinimalApi.csproj index fe77ac5..0a2281e 100644 --- a/src/Sample/MinimalApi/MinimalApi.csproj +++ b/src/Sample/MinimalApi/MinimalApi.csproj @@ -6,6 +6,7 @@ enable https://api.nuget.org/v3/index.json;$(PackageOutputPath) true + false diff --git a/src/Sample/MinimalApi/Program.cs b/src/Sample/MinimalApi/Program.cs index 88ad597..c1ad909 100644 --- a/src/Sample/MinimalApi/Program.cs +++ b/src/Sample/MinimalApi/Program.cs @@ -1,4 +1,5 @@ using Sample; +using StructId; var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); @@ -8,6 +9,6 @@ app.Run(); -readonly partial record struct UserId : IStructId; +readonly partial record struct UserId(int Value) : IStructId; record User(UserId id, string Alias); \ No newline at end of file diff --git a/src/Sample/MvcWebApp/Controllers/HomeController.cs b/src/Sample/MvcWebApp/Controllers/HomeController.cs index abd538a..fe49308 100644 --- a/src/Sample/MvcWebApp/Controllers/HomeController.cs +++ b/src/Sample/MvcWebApp/Controllers/HomeController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc; using Sample; +using StructId; namespace MvcWebApplication.Controllers; @@ -24,6 +25,6 @@ public IActionResult GetProduct(ProductId? id) } } -public readonly partial record struct UserId : IStructId; +public readonly partial record struct UserId : IStructId; public record User(UserId id, string Alias); \ No newline at end of file diff --git a/src/Sample/MvcWebApp/MvcWebApp.csproj b/src/Sample/MvcWebApp/MvcWebApp.csproj index fe77ac5..25d835a 100644 --- a/src/Sample/MvcWebApp/MvcWebApp.csproj +++ b/src/Sample/MvcWebApp/MvcWebApp.csproj @@ -6,8 +6,13 @@ enable https://api.nuget.org/v3/index.json;$(PackageOutputPath) true + false + + + + diff --git a/src/StructId.Analyzer/Properties/launchSettings.json b/src/StructId.Analyzer/Properties/launchSettings.json index 98ff4e5..dabd937 100644 --- a/src/StructId.Analyzer/Properties/launchSettings.json +++ b/src/StructId.Analyzer/Properties/launchSettings.json @@ -3,6 +3,10 @@ "Roslyn": { "commandName": "DebugRoslynComponent", "targetProject": "..\\StructId.FunctionalTests\\StructId.FunctionalTests.csproj" + }, + "MinimalApi": { + "commandName": "DebugRoslynComponent", + "targetProject": "..\\Sample\\MinimalApi\\MinimalApi.csproj" } } } \ No newline at end of file