Records Support Documentation Update

Created: 2026-01-01 Completed: 2026-01-01 Status: Completed Priority: High

Summary

Neatoo 10.1.1 and RemoteFactory 10.1.0 introduced C# record support. This todo tracks updating all documentation to reflect this new capability.

Source Repository Commits

Neatoo (since 4c83d45 on 2025-12-30)

Commit Date Description
0df02e5 2026-01-01 10.1.1 - RemoteFactory 10.1.1. Support for Records
1b0695f 2025-12-31 .NET 8, .NET 9 and .NET 10 support
d4c4ce2 2025-12-31 Race condition fix in AsyncTasksTests

RemoteFactory (since 9e62dda on 2025-12-30)

Commit Date Description
27760f8 2026-01-01 10.1.0 - Record Support
9cb1ee5 2026-01-01 v10.1.1 - Directory.build fix
b90ba4d 2026-01-01 .NET 8.0, .NET 9.0, .NET 10.0 target support

New Records Features (10.1.0+)

Capabilities

  1. Type-Level [Create]: Records with primary constructors can use [Create] on the type declaration
  2. Service Injection: [Service] attribute works in positional record parameters
  3. Fetch Operations: Static [Fetch] methods work with records (sync and async)
  4. Remote Operations: Records fully support [Remote] with proper serialization
  5. Serialization: Records serialize correctly through NeatooJsonSerializer

Constraints

Documentation Site Updates

High Priority

Medium Priority

Low Priority

Required

Skill File Updates

Required

Optional

Code Examples to Add

Basic Record Value Object

[Factory]
[Create]
public record Money(decimal Amount, string Currency = "USD");

// Generated:
public interface IMoneyFactory
{
    Money Create(decimal amount, string currency = "USD");
}

Record with Service Injection

[Factory]
[Create]
public record Address(
    string Street,
    string City,
    string State,
    string ZipCode,
    [Service] IAddressValidator validator);

// Generated (services hidden):
public interface IAddressFactory
{
    Address Create(string street, string city, string state, string zipCode);
}

Record with Fetch

[Factory]
[Create]
public record CustomerSummary(Guid Id, string? Name, string? Email)
{
    [Remote]
    [Fetch]
    public static async Task<CustomerSummary?> Fetch(
        Guid id,
        [Service] IDbContext db)
    {
        var entity = await db.Customers.FindAsync(id);
        return entity is null ? null
            : new CustomerSummary(entity.Id, entity.Name, entity.Email);
    }
}

Record with Remote Operations

[Factory]
[Create]
public record OrderLookupResult(
    Guid OrderId,
    string? CustomerName,
    decimal Total,
    OrderStatus Status)
{
    [Remote]
    [Fetch]
    public static async Task<OrderLookupResult?> Fetch(
        Guid orderId,
        [Service] IOrderRepository repo)
    {
        return await repo.GetOrderSummaryAsync(orderId);
    }
}

Validation Checklist

After updates, verify:

Notes