From 2c5bd0c8a0e35c7476d2fe1d1a9a41684ac40662 Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 17:11:22 -0500 Subject: [PATCH 01/13] Working on package version number issues --- .../BlazorExample/Directory.Packages.props | 10 +++---- Source/Directory.Package.props | 27 +++++++------------ Source/version.json | 2 +- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Samples/BlazorExample/Directory.Packages.props b/Samples/BlazorExample/Directory.Packages.props index f70ae17d1e..03b3e5b83d 100644 --- a/Samples/BlazorExample/Directory.Packages.props +++ b/Samples/BlazorExample/Directory.Packages.props @@ -1,13 +1,13 @@ true - 9.0.0-alpha-g27c299cae5 + 10.0.0-alpha.4 - - - - + + + + diff --git a/Source/Directory.Package.props b/Source/Directory.Package.props index 9d04c7dc30..a3b60c250e 100644 --- a/Source/Directory.Package.props +++ b/Source/Directory.Package.props @@ -1,15 +1,15 @@ - - - - - - - @(VersionJsonLines) - $([System.Text.RegularExpressions.Regex]::Match($(VersionJsonContent), '"version"\s*:\s*"([^"]+)"').Groups[1].Value) - - + + + <_VersionJsonPath>$(MSBuildThisFileDirectory)version.json + <_VersionJsonContent Condition="Exists('$(_VersionJsonPath)')">$([System.IO.File]::ReadAllText('$(_VersionJsonPath)')) + $([System.Text.RegularExpressions.Regex]::Match($(_VersionJsonContent), '"version"\s*:\s*"([^"]+)"').Groups[1].Value.Trim()) + $([System.Text.RegularExpressions.Regex]::Match($(PackageVersionFromJson), '^([0-9]+\.[0-9]+\.[0-9]+)').Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match($(PackageVersionFromJson), '^[0-9]+\.[0-9]+\.[0-9]+(?:-(.+))?$').Groups[1].Value) + $(PackageVersionFromJson) + $(PackageVersionFromJson) + @@ -44,13 +44,6 @@ - - - - $(PackageVersionFromJson) - - - diff --git a/Source/version.json b/Source/version.json index d820711bec..a40314de3f 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha.3", + "version": "10.0.0-alpha.4", "publicReleaseRefSpec": [ "^refs/heads/.*" ], From 594e7a070e8f806f8af9a6c96cce8764250583f8 Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 17:25:43 -0500 Subject: [PATCH 02/13] More versioning work --- Source/Directory.Build.props | 9 ++++++++- Source/Directory.Package.props | 15 +-------------- Source/version.json | 18 +++++++++--------- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index 4cd8b6ed12..585f331ec9 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -9,7 +9,6 @@ - 10.0.0.0 MIT https://cslanet.com https://github.com/MarimerLLC/csla @@ -24,4 +23,12 @@ en-US $(SolutionDir)Csla\CslaKey.snk + + + + + all + 3.8.118 + + \ No newline at end of file diff --git a/Source/Directory.Package.props b/Source/Directory.Package.props index a3b60c250e..255a128745 100644 --- a/Source/Directory.Package.props +++ b/Source/Directory.Package.props @@ -1,19 +1,6 @@ - - - - <_VersionJsonPath>$(MSBuildThisFileDirectory)version.json - <_VersionJsonContent Condition="Exists('$(_VersionJsonPath)')">$([System.IO.File]::ReadAllText('$(_VersionJsonPath)')) - $([System.Text.RegularExpressions.Regex]::Match($(_VersionJsonContent), '"version"\s*:\s*"([^"]+)"').Groups[1].Value.Trim()) - $([System.Text.RegularExpressions.Regex]::Match($(PackageVersionFromJson), '^([0-9]+\.[0-9]+\.[0-9]+)').Groups[1].Value) - $([System.Text.RegularExpressions.Regex]::Match($(PackageVersionFromJson), '^[0-9]+\.[0-9]+\.[0-9]+(?:-(.+))?$').Groups[1].Value) - $(PackageVersionFromJson) - $(PackageVersionFromJson) - - - $(PackageVersionFromJson) MIT https://cslanet.com ..\..\bin\packages\ @@ -38,7 +25,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Source/version.json b/Source/version.json index a40314de3f..e82741458c 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,13 +1,13 @@ { - "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha.4", + "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", + "version": "10.0.0-alpha", "publicReleaseRefSpec": [ - "^refs/heads/.*" + "^refs/heads/main$", + "^refs/heads/v\\d+(?:\\.\\d+)?$" ], - "nuGetPackageVersion": { - "semVer": 2 - }, - "assemblyVersion": { - "precision": "build" + "cloudBuild": { + "buildNumber": { + "enabled": true + } } -} +} \ No newline at end of file From 75115c7446ef4266a2ee28c0154a0a4139254d4c Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 17:34:22 -0500 Subject: [PATCH 03/13] Hopefully got versioning working --- Source/Directory.Build.props | 1 - .../Csla.Analyzers.Tests/Properties/AssemblyInfo.cs | 2 -- Source/tests/Csla.test/Properties/AssemblyInfo.cs | 12 ------------ Source/version.json | 2 +- docs/dev/Create-a-CSLA-.NET-release.md | 1 + 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index 585f331ec9..550600d8be 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -24,7 +24,6 @@ $(SolutionDir)Csla\CslaKey.snk - all diff --git a/Source/tests/Csla.Analyzers.Tests/Properties/AssemblyInfo.cs b/Source/tests/Csla.Analyzers.Tests/Properties/AssemblyInfo.cs index 73dee0cbf4..b5f403cb70 100644 --- a/Source/tests/Csla.Analyzers.Tests/Properties/AssemblyInfo.cs +++ b/Source/tests/Csla.Analyzers.Tests/Properties/AssemblyInfo.cs @@ -3,5 +3,3 @@ [assembly: AssemblyTitle("Csla.Analyzers")] [assembly: AssemblyProduct("Csla.Analyzers")] [assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file diff --git a/Source/tests/Csla.test/Properties/AssemblyInfo.cs b/Source/tests/Csla.test/Properties/AssemblyInfo.cs index 71e6a45a48..90953b3385 100644 --- a/Source/tests/Csla.test/Properties/AssemblyInfo.cs +++ b/Source/tests/Csla.test/Properties/AssemblyInfo.cs @@ -27,15 +27,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("c83f79e5-ed07-4c9e-b436-217b5eb03d65")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("4.5.30.0")] -[assembly: AssemblyFileVersion("4.5.30.0")] diff --git a/Source/version.json b/Source/version.json index e82741458c..9ef0955f0f 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha", + "version": "10.0.0-alpha6", "publicReleaseRefSpec": [ "^refs/heads/main$", "^refs/heads/v\\d+(?:\\.\\d+)?$" diff --git a/docs/dev/Create-a-CSLA-.NET-release.md b/docs/dev/Create-a-CSLA-.NET-release.md index 53a54c3fc1..fc16804f1a 100644 --- a/docs/dev/Create-a-CSLA-.NET-release.md +++ b/docs/dev/Create-a-CSLA-.NET-release.md @@ -22,6 +22,7 @@ CSLA .NET, starting with version 4.9.0, follows the [semantic versioning (semver 1. Pull the latest code from MarimerLLC/csla 1. Open the `Source/version.json` file and update the version number +1. ⚠️ Commit the change to git ⚠️ 1. Do NuGet release 1. Open a terminal window 1. Change to the `csla/Source` folder From c502aa9d0ca3c2f3778c41316d7f9316ec720814 Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 17:35:28 -0500 Subject: [PATCH 04/13] Try without cloud number --- Source/version.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/version.json b/Source/version.json index 9ef0955f0f..699d0b026b 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,13 +1,13 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha6", + "version": "10.0.0-alpha7", "publicReleaseRefSpec": [ "^refs/heads/main$", "^refs/heads/v\\d+(?:\\.\\d+)?$" ], "cloudBuild": { "buildNumber": { - "enabled": true + "enabled": false } } } \ No newline at end of file From 27875abac4b42682ea096c263104ff2ba91d5a79 Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 17:35:41 -0500 Subject: [PATCH 05/13] Better version --- Source/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/version.json b/Source/version.json index 699d0b026b..fad11f5c2d 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha7", + "version": "10.0.0-alpha.7", "publicReleaseRefSpec": [ "^refs/heads/main$", "^refs/heads/v\\d+(?:\\.\\d+)?$" From 370995653facb173745f0de1fe3b1fd63391195f Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 17:40:12 -0500 Subject: [PATCH 06/13] Update pre-release --- Source/version.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/version.json b/Source/version.json index fad11f5c2d..98a7468e2d 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,8 +1,9 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha.7", + "version": "10.0.0-alpha.8", "publicReleaseRefSpec": [ "^refs/heads/main$", + "^refs/heads/release$", "^refs/heads/v\\d+(?:\\.\\d+)?$" ], "cloudBuild": { From 6c6077898c089228eb649c9036a9123776ac7fd7 Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 17:53:07 -0500 Subject: [PATCH 07/13] Update to CSLA 10, add nullable support --- .../BlazorExample.Client/Components/Pages/EditPerson.razor | 4 ++-- .../Components/Pages/EditPersonViaForm.razor | 4 ++-- .../BlazorExample.Client/Components/Pages/ListPersons.razor | 2 +- .../BlazorExample/BlazorExample/BusinessLibrary/CheckCase.cs | 2 +- .../BlazorExample/BusinessLibrary/LetterCount.cs | 4 ++-- .../BlazorExample/BlazorExample/BusinessLibrary/NoZAllowed.cs | 4 ++-- .../BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs | 4 ++-- .../BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs | 4 ++-- .../BlazorExample/DataAccess.EF/DataAccess.EF.csproj | 2 ++ .../BlazorExample/DataAccess.Mock/DataAccess.Mock.csproj | 2 ++ .../BlazorExample/BlazorExample/DataAccess/DataAccess.csproj | 2 ++ .../BlazorExample/BlazorExample/DataAccess/PersonEntity.cs | 2 +- Samples/BlazorExample/Directory.Packages.props | 2 +- 13 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPerson.razor b/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPerson.razor index 3a6209d1f9..a6aa29eefb 100644 --- a/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPerson.razor +++ b/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPerson.razor @@ -82,8 +82,8 @@ else vm.ModelPropertyChanged += async (s, e) => await InvokeAsync(() => StateHasChanged()); if (string.IsNullOrWhiteSpace(id)) - await vm.RefreshAsync(() => personEditPortal.CreateAsync()); + await vm.RefreshAsync(async () => (PersonEdit?)(await personEditPortal.CreateAsync())); else - await vm.RefreshAsync(() => personEditPortal.FetchAsync(int.Parse(id))); + await vm.RefreshAsync(async () => (PersonEdit?)(await personEditPortal.FetchAsync(int.Parse(id)))); } } diff --git a/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPersonViaForm.razor b/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPersonViaForm.razor index d7ff428115..8e5edc7fa4 100644 --- a/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPersonViaForm.razor +++ b/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/EditPersonViaForm.razor @@ -56,8 +56,8 @@ else vm.ModelPropertyChanged += async (s, e) => await InvokeAsync(() => StateHasChanged()); if (string.IsNullOrWhiteSpace(id)) - await vm.RefreshAsync(() => personEditPortal.CreateAsync()); + await vm.RefreshAsync(async () => (PersonEdit?)(await personEditPortal.CreateAsync())); else - await vm.RefreshAsync(() => personEditPortal.FetchAsync(int.Parse(id))); + await vm.RefreshAsync(async () => (PersonEdit?)(await personEditPortal.FetchAsync(int.Parse(id)))); } } diff --git a/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/ListPersons.razor b/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/ListPersons.razor index 762260dee5..29e244d976 100644 --- a/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/ListPersons.razor +++ b/Samples/BlazorExample/BlazorExample/BlazorExample.Client/Components/Pages/ListPersons.razor @@ -42,6 +42,6 @@ else { // Every page _must_ initialize the state manager await StateManager.InitializeAsync(); - await vm.RefreshAsync(() => personListPortal.FetchAsync()); + await vm.RefreshAsync(async () => (PersonList?)(await personListPortal.FetchAsync())); } } \ No newline at end of file diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/CheckCase.cs b/Samples/BlazorExample/BlazorExample/BusinessLibrary/CheckCase.cs index d1300d7566..30d6a6fe56 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/CheckCase.cs +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/CheckCase.cs @@ -10,7 +10,7 @@ public CheckCase(Csla.Core.IPropertyInfo primaryProperty) protected override void Execute(IRuleContext context) { - var text = (string)ReadProperty(context.Target, PrimaryProperty); + var text = (string?)ReadProperty(context.Target!, PrimaryProperty!); if (string.IsNullOrWhiteSpace(text)) return; var ideal = text.Substring(0, 1).ToUpper(); ideal += text.Substring(1).ToLower(); diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/LetterCount.cs b/Samples/BlazorExample/BlazorExample/BusinessLibrary/LetterCount.cs index 891d4337c6..2eb4425f92 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/LetterCount.cs +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/LetterCount.cs @@ -12,8 +12,8 @@ public LetterCount(Csla.Core.IPropertyInfo primaryProperty, Csla.Core.IPropertyI protected override void Execute(IRuleContext context) { - var text = (string)ReadProperty(context.Target, PrimaryProperty); - var count = text.Length; + var text = (string?)ReadProperty(context.Target!, PrimaryProperty!); + var count = text?.Length ?? 0; context.AddOutValue(AffectedProperties[1], count); } } diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/NoZAllowed.cs b/Samples/BlazorExample/BlazorExample/BusinessLibrary/NoZAllowed.cs index dba495744f..e831a3d84a 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/NoZAllowed.cs +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/NoZAllowed.cs @@ -10,8 +10,8 @@ public NoZAllowed(Csla.Core.IPropertyInfo primaryProperty) protected override void Execute(IRuleContext context) { - var text = (string)ReadProperty(context.Target, PrimaryProperty); - if (text.ToLower().Contains("z")) + var text = (string?)ReadProperty(context.Target!, PrimaryProperty!); + if (text?.ToLower().Contains("z") ?? false) context.AddErrorResult("No letter Z allowed"); } } diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs index 486a127404..c2502c8ca3 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs @@ -14,9 +14,9 @@ public int Id set { SetProperty(IdProperty, value); } } - public static readonly PropertyInfo NameProperty = RegisterProperty(nameof(Name)); + public static readonly PropertyInfo NameProperty = RegisterProperty(nameof(Name)); [Required] - public string Name + public string? Name { get { return GetProperty(NameProperty); } set { SetProperty(NameProperty, value); } diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs index decd4d62cf..5ca24f3c71 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs @@ -12,8 +12,8 @@ public int Id private set { LoadProperty(IdProperty, value); } } - public static readonly PropertyInfo NameProperty = RegisterProperty(nameof(Name)); - public string Name + public static readonly PropertyInfo NameProperty = RegisterProperty(nameof(Name)); + public string? Name { get { return GetProperty(NameProperty); } private set { LoadProperty(NameProperty, value); } diff --git a/Samples/BlazorExample/BlazorExample/DataAccess.EF/DataAccess.EF.csproj b/Samples/BlazorExample/BlazorExample/DataAccess.EF/DataAccess.EF.csproj index 32b4a38b4a..9031da74fc 100644 --- a/Samples/BlazorExample/BlazorExample/DataAccess.EF/DataAccess.EF.csproj +++ b/Samples/BlazorExample/BlazorExample/DataAccess.EF/DataAccess.EF.csproj @@ -2,6 +2,8 @@ net9.0 + enable + enable diff --git a/Samples/BlazorExample/BlazorExample/DataAccess.Mock/DataAccess.Mock.csproj b/Samples/BlazorExample/BlazorExample/DataAccess.Mock/DataAccess.Mock.csproj index 76fa23bf9a..d8c5a19d00 100644 --- a/Samples/BlazorExample/BlazorExample/DataAccess.Mock/DataAccess.Mock.csproj +++ b/Samples/BlazorExample/BlazorExample/DataAccess.Mock/DataAccess.Mock.csproj @@ -2,6 +2,8 @@ net9.0 + enable + enable DataAccess.Mock diff --git a/Samples/BlazorExample/BlazorExample/DataAccess/DataAccess.csproj b/Samples/BlazorExample/BlazorExample/DataAccess/DataAccess.csproj index 1cdc2f0a17..09fc3f59e3 100644 --- a/Samples/BlazorExample/BlazorExample/DataAccess/DataAccess.csproj +++ b/Samples/BlazorExample/BlazorExample/DataAccess/DataAccess.csproj @@ -2,6 +2,8 @@ net9.0 + enable + enable diff --git a/Samples/BlazorExample/BlazorExample/DataAccess/PersonEntity.cs b/Samples/BlazorExample/BlazorExample/DataAccess/PersonEntity.cs index 093403441a..e8087b313c 100644 --- a/Samples/BlazorExample/BlazorExample/DataAccess/PersonEntity.cs +++ b/Samples/BlazorExample/BlazorExample/DataAccess/PersonEntity.cs @@ -7,6 +7,6 @@ namespace DataAccess public class PersonEntity { public int Id { get; set; } - public string Name { get; set; } + public string? Name { get; set; } } } diff --git a/Samples/BlazorExample/Directory.Packages.props b/Samples/BlazorExample/Directory.Packages.props index 03b3e5b83d..6d6a76ef40 100644 --- a/Samples/BlazorExample/Directory.Packages.props +++ b/Samples/BlazorExample/Directory.Packages.props @@ -1,7 +1,7 @@ true - 10.0.0-alpha.4 + 10.0.0-alpha-0008-g370995653f From cba43f4af48a2937a6699d5ab7dc40e8f726c387 Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 18:47:58 -0500 Subject: [PATCH 08/13] Update version --- Source/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/version.json b/Source/version.json index 98a7468e2d..9927ace82c 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha.8", + "version": "10.0.0-alpha.9", "publicReleaseRefSpec": [ "^refs/heads/main$", "^refs/heads/release$", From f7bf2e4bd1c71b1bf4f931d58adce4336664adeb Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 18:55:22 -0500 Subject: [PATCH 09/13] DevelopmentDependency must be false for attributes to be visible --- .../Csla.Generator.AutoImplementProperties.CSharp.csproj | 2 +- .../Csla.Generator.AutoSerialization.CSharp.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj index 7b3a119b74..95b278a284 100644 --- a/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj +++ b/Source/Csla.Generators/cs/AutoImplementProperties/Csla.Generator.AutoImplementProperties.CSharp/Csla.Generator.AutoImplementProperties.CSharp.csproj @@ -26,7 +26,7 @@ true - true + false true diff --git a/Source/Csla.Generators/cs/AutoSerialization/Csla.Generator.AutoSerialization.CSharp/Csla.Generator.AutoSerialization.CSharp.csproj b/Source/Csla.Generators/cs/AutoSerialization/Csla.Generator.AutoSerialization.CSharp/Csla.Generator.AutoSerialization.CSharp.csproj index b43d99519a..0149faf4a9 100644 --- a/Source/Csla.Generators/cs/AutoSerialization/Csla.Generator.AutoSerialization.CSharp/Csla.Generator.AutoSerialization.CSharp.csproj +++ b/Source/Csla.Generators/cs/AutoSerialization/Csla.Generator.AutoSerialization.CSharp/Csla.Generator.AutoSerialization.CSharp.csproj @@ -26,7 +26,7 @@ true - true + false true From 4f4755856c775dc151e54b3cc7afbb3d78f839a6 Mon Sep 17 00:00:00 2001 From: Rockford lhotka Date: Thu, 23 Oct 2025 18:59:10 -0500 Subject: [PATCH 10/13] Update for CSLA 10 --- .../BusinessLibrary/BusinessLibrary.csproj | 2 + .../BusinessLibrary/PersonEdit.cs | 70 ++++++------------- .../BusinessLibrary/PersonInfo.cs | 22 ++---- .../BlazorExample/Directory.Packages.props | 3 +- 4 files changed, 33 insertions(+), 64 deletions(-) diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/BusinessLibrary.csproj b/Samples/BlazorExample/BlazorExample/BusinessLibrary/BusinessLibrary.csproj index f0d1de92f7..24ee6423c5 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/BusinessLibrary.csproj +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/BusinessLibrary.csproj @@ -4,10 +4,12 @@ net9.0 enable enable + true + diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs index c2502c8ca3..e12cf8e7bf 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonEdit.cs @@ -4,30 +4,15 @@ namespace BusinessLibrary { - [Serializable] - public class PersonEdit : BusinessBase + [CslaImplementProperties] + public partial class PersonEdit : BusinessBase { - public static readonly PropertyInfo IdProperty = RegisterProperty(nameof(Id)); - public int Id - { - get { return GetProperty(IdProperty); } - set { SetProperty(IdProperty, value); } - } + public partial int Id { get; private set; } - public static readonly PropertyInfo NameProperty = RegisterProperty(nameof(Name)); [Required] - public string? Name - { - get { return GetProperty(NameProperty); } - set { SetProperty(NameProperty, value); } - } + public partial string? Name { get; set; } - public static readonly PropertyInfo NameLengthProperty = RegisterProperty(nameof(NameLength)); - public int NameLength - { - get => GetProperty(NameLengthProperty); - set => SetProperty(NameLengthProperty, value); - } + public partial int NameLength { get; private set; } [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] [ObjectAuthorizationRules] @@ -53,58 +38,49 @@ protected override void AddBusinessRules() [Create] private void Create() { - Id = -1; - base.Child_Create(); + LoadProperty(IdProperty, -1); } [Fetch] - private void Fetch(int id, [Inject]DataAccess.IPersonDal dal) + private void Fetch(int id, [Inject] DataAccess.IPersonDal dal) { var data = dal.Get(id); - using (BypassPropertyChecks) - Csla.Data.DataMapper.Map(data, this); + Csla.Data.DataMapper.Map(data, this); BusinessRules.CheckRules(); } [Insert] - private void Insert([Inject]DataAccess.IPersonDal dal) + private void Insert([Inject] DataAccess.IPersonDal dal) { - using (BypassPropertyChecks) + var data = new DataAccess.PersonEntity { - var data = new DataAccess.PersonEntity - { - Name = Name - }; - var result = dal.Insert(data); - Id = result.Id; - } + Name = Name + }; + var result = dal.Insert(data); + LoadProperty(IdProperty, result.Id); } [Update] - private void Update([Inject]DataAccess.IPersonDal dal) + private void Update([Inject] DataAccess.IPersonDal dal) { - using (BypassPropertyChecks) + var data = new DataAccess.PersonEntity { - var data = new DataAccess.PersonEntity - { - Id = Id, - Name = Name - }; - dal.Update(data); - } + Id = Id, + Name = Name + }; + dal.Update(data); } [DeleteSelf] - private void DeleteSelf([Inject]DataAccess.IPersonDal dal) + private void DeleteSelf([Inject] DataAccess.IPersonDal dal) { - Delete(ReadProperty(IdProperty), dal); + Delete(Id, dal); } [Delete] - private void Delete(int id, [Inject]DataAccess.IPersonDal dal) + private void Delete(int id, [Inject] DataAccess.IPersonDal dal) { dal.Delete(id); } - } } diff --git a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs index 5ca24f3c71..959b0886ec 100644 --- a/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs +++ b/Samples/BlazorExample/BlazorExample/BusinessLibrary/PersonInfo.cs @@ -2,28 +2,18 @@ namespace BusinessLibrary { - [Serializable] - public class PersonInfo : ReadOnlyBase + [CslaImplementProperties] + public partial class PersonInfo : ReadOnlyBase { - public static readonly PropertyInfo IdProperty = RegisterProperty(nameof(Id)); - public int Id - { - get { return GetProperty(IdProperty); } - private set { LoadProperty(IdProperty, value); } - } + public partial int Id { get; private set; } - public static readonly PropertyInfo NameProperty = RegisterProperty(nameof(Name)); - public string? Name - { - get { return GetProperty(NameProperty); } - private set { LoadProperty(NameProperty, value); } - } + public partial string? Name { get; private set; } [FetchChild] private void Fetch(DataAccess.PersonEntity data) { - Id = data.Id; - Name = data.Name; + LoadProperty(IdProperty, data.Id); + LoadProperty(NameProperty, data.Name); } } } \ No newline at end of file diff --git a/Samples/BlazorExample/Directory.Packages.props b/Samples/BlazorExample/Directory.Packages.props index 6d6a76ef40..d474f7f934 100644 --- a/Samples/BlazorExample/Directory.Packages.props +++ b/Samples/BlazorExample/Directory.Packages.props @@ -1,13 +1,14 @@ true - 10.0.0-alpha-0008-g370995653f + 10.0.0-alpha-0009-gcba43f4af4 + From 25cd043a1dfd1094dece740cae8b30491c7f0c91 Mon Sep 17 00:00:00 2001 From: Rockford Lhotka Date: Sun, 26 Oct 2025 22:29:19 +0100 Subject: [PATCH 11/13] Remove duplicate reference --- Samples/BlazorExample/Directory.Packages.props | 2 +- Source/Directory.Package.props | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Samples/BlazorExample/Directory.Packages.props b/Samples/BlazorExample/Directory.Packages.props index d474f7f934..6369fa758e 100644 --- a/Samples/BlazorExample/Directory.Packages.props +++ b/Samples/BlazorExample/Directory.Packages.props @@ -1,7 +1,7 @@ true - 10.0.0-alpha-0009-gcba43f4af4 + 10.0.0-alpha-0009-g2abd6121c5 diff --git a/Source/Directory.Package.props b/Source/Directory.Package.props index 255a128745..71021d7fe1 100644 --- a/Source/Directory.Package.props +++ b/Source/Directory.Package.props @@ -24,13 +24,6 @@ False - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - From 1bed2a0dfa34e1072f753f99d94383197cdb80e2 Mon Sep 17 00:00:00 2001 From: Rockford Lhotka Date: Wed, 29 Oct 2025 00:30:17 +0100 Subject: [PATCH 12/13] Update version --- Source/version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/version.json b/Source/version.json index 9927ace82c..d35f6d505c 100644 --- a/Source/version.json +++ b/Source/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "10.0.0-alpha.9", + "version": "10.0.0-alpha.10", "publicReleaseRefSpec": [ "^refs/heads/main$", "^refs/heads/release$", From 3cefcb84c585bbb005648f3aa720b8ba17f8c34d Mon Sep 17 00:00:00 2001 From: Rockford Lhotka Date: Thu, 30 Oct 2025 22:38:08 +0000 Subject: [PATCH 13/13] Fix broken test --- Source/tests/Csla.test/Serialization/SerializationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/tests/Csla.test/Serialization/SerializationTests.cs b/Source/tests/Csla.test/Serialization/SerializationTests.cs index c682f2e012..aea6a5d069 100644 --- a/Source/tests/Csla.test/Serialization/SerializationTests.cs +++ b/Source/tests/Csla.test/Serialization/SerializationTests.cs @@ -435,7 +435,7 @@ public void TestSerializationNames() Assert.AreEqual("Csla.ApplicationContext, /c", AssemblyNameTranslator.GetSerializationName(typeof(ApplicationContext), false)); Assert.AreEqual("Csla.ApplicationContext, /c", AssemblyNameTranslator.GetSerializationName(typeof(ApplicationContext), true)); Assert.AreEqual("Csla.Test.Serialization.BinaryReaderWriterTestClass, Csla.Tests", AssemblyNameTranslator.GetSerializationName(typeof(BinaryReaderWriterTestClass), false)); - Assert.AreEqual("Csla.Test.Serialization.BinaryReaderWriterTestClass, Csla.Tests, Version=4.5.30.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30", AssemblyNameTranslator.GetSerializationName(typeof(BinaryReaderWriterTestClass), true)); + Assert.AreEqual("Csla.Test.Serialization.BinaryReaderWriterTestClass, Csla.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=93be5fdc093e4c30", AssemblyNameTranslator.GetSerializationName(typeof(BinaryReaderWriterTestClass), true)); } // TODO: fix test