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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Source/Csla.Xaml.Uwp/Csla.Xaml.Uwp.nuget.props
Source/Csla.Xaml.Uwp/project.lock.json

*.bak
*.swp
/Source/Csla.Android/Csla.Android.csproj.bak
/Source/Csla.Axml.Android/Csla.Axml.Android.csproj.bak
/Source/Csla.Validation.Android/Csla.Validation.Android.csproj.bak
Expand Down
108 changes: 108 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Repository Overview

CSLA .NET is a business object framework for .NET. Current version is **10.1.0** (set via Nerdbank.GitVersioning in `Source/version.json`). The core package targets `netstandard2.0`, `net462`, `net472`, `net48`, `net8.0`, `net9.0`, and `net10.0`. Requires **.NET SDK 10.0.100+** (see `Source/global.json`).

## Build and Test Commands

### Build everything (framework + tests)
```
dotnet build Source\csla.test.sln
```

### Run all tests
```
dotnet test Source\csla.test.sln --no-build --verbosity normal --filter TestCategory!=SkipOnCIServer --settings Source/test.runsettings
```

### Run a single test by name
```
dotnet test Source\csla.test.sln --no-build --filter "FullyQualifiedName~Csla.Test.ClassName.MethodName"
```

### Build only framework (no tests)
```
dotnet build Source\csla.build.sln
```

### Build MAUI projects (requires `dotnet workload install maui`)
```
dotnet build Source/csla.maui.build.sln
```

### Build analyzers/generators
```
dotnet build Source\Csla.Analyzers.sln
```

## Solution Files

| Solution | Purpose |
|---|---|
| `Source\csla.test.sln` | **Primary** — framework + all tests (used by CI) |
| `Source\csla.build.sln` | Framework libraries only (no tests) |
| `Source\csla.maui.test.sln` | MAUI-specific build + tests |
| `Source\Csla.Analyzers.sln` | Roslyn analyzers |
| `Source\csla.benchmarks.sln` | BenchmarkDotNet performance tests |

## Project Architecture

### Core Framework (`Source/Csla/`)
The main NuGet package. Key subsystems:
- **Business base classes** — `BusinessBase`, `ReadOnlyBase`, `CommandBase`, `BusinessListBase`, `ReadOnlyListBase`, `NameValueListBase`, `DynamicListBase` (root-level .cs files)
- **Data Portal** — Client-side in `DataPortalClient/` (proxies: `LocalProxy`, `HttpProxy`, `HttpCompressionProxy`), server-side in `Server/` (`SimpleDataPortal`, `DataPortalBroker`, `DataPortalSelector`, `ChildDataPortal`). `DataPortalT.cs` and `IDataPortalT.cs` define the generic `DataPortal<T>` / `IDataPortal<T>` interfaces.
- **Rules engine** — `Rules/` contains business rules (`BusinessRule`, `CommonRules`) and authorization rules (`AuthorizationRule`). `BrokenRulesCollection` tracks validation state.
- **Serialization** — `Serialization/` with `MobileFormatter` for CSLA's custom serialization. Source generators for auto-serialization in `Csla.Generators/cs/AutoSerialization/`.
- **Configuration** — `Configuration/` with DI registration via `CslaBuilder` and `AddCsla()` extension methods.
- **Core infrastructure** — `Core/` (property management, undo/n-level undo, `ManagedObjectBase`), `Security/`, `State/`, `Reflection/`

### UI Support Packages
- `Csla.AspNetCore` — ASP.NET Core integration (controllers, DI)
- `Csla.Blazor` / `Csla.Blazor.WebAssembly` — Blazor component support
- `Csla.Windows` — WinForms binding support
- `Csla.Xaml.Wpf` — WPF binding support
- `Csla.Xaml.Maui` — .NET MAUI support

### Channel Packages
- `Csla.Channels.Grpc` — gRPC data portal channel
- `Csla.Channels.RabbitMq` — RabbitMQ data portal channel

### Analyzers and Generators
- `Source/Csla.Analyzers/` — Roslyn analyzers shipped inside the Csla NuGet
- `Source/Csla.Generators/cs/AutoSerialization/` — Source generator for `[AutoSerialization]`
- `Source/Csla.Generators/cs/AutoImplementProperties/` — Source generator for auto-implementing CSLA properties
- `Source/Csla.Generator.DataPortalInterfaces.CSharp/` — Source generator for data portal interface generation

### Test Projects (under `Source/tests/`)
- `Csla.test` — Main test suite (MSTest + FluentAssertions)
- `csla.netcore.test` — .NET-specific tests (MSTest + AwesomeAssertions)
- `Csla.Blazor.Test` / `Csla.Blazor.WebAssembly.Tests` — Blazor tests
- `Csla.Windows.Tests` — WinForms tests
- `Csla.Analyzers.Tests` — Analyzer unit tests
- `Csla.Generator.*.Tests` — Generator unit tests
- `GraphMergerTest` — Object graph merge testing

## Coding Standards

- **Indent**: 2 spaces (set in `.editorconfig`)
- **Line endings**: CRLF
- **C# style**: Allman braces, `var` everywhere, expression-bodied members preferred
- **Field naming**: `_fieldName` for instance fields
- **Nullable**: Enabled in framework code (`WarningsAsErrors=nullable`), disabled in test projects
- **Language version**: `latest`
- **Implicit usings**: Enabled
- **Assemblies are strong-named** using `CslaKey.snk`

## Commit Message Format

Include the GitHub issue number: `#999 Description of change`

## CI Notes

- CI runs on `windows-latest` with .NET 10 SDK
- Tests use `--settings Source/test.runsettings` which limits `MaxCpuCount` to 1 (tests must not run in parallel)
- Tests with `[TestCategory("SkipOnCIServer")]` are excluded from CI runs
- MAUI build only triggers when `Source/Csla.Xaml.Maui/`, `Source/Csla.Xaml.Shared/`, or `Source/csla.maui.test.sln` are modified
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\Directory.Package.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsRoslynComponent>true</IsRoslynComponent>
<IncludeBuildOutput>false</IncludeBuildOutput>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<NoWarn>RS2008</NoWarn>
<BaseOutputPath>..\..\..\..\..\Bin</BaseOutputPath>
<OutputPath>..\..\..\..\..\bin\packages\</OutputPath>
<AssemblyName>Csla.Generator.DataPortalInterfaces.CSharp</AssemblyName>
<RootNamespace>Csla.Generator.DataPortalInterfaces.CSharp</RootNamespace>
<Description>CSLA .NET Generator DataPortalInterfaces for CSharp</Description>
<SignAssembly>true</SignAssembly>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.9.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Polyfill" Version="8.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Loading
Loading