| layout | default |
|---|---|
| title | v0.13.0 |
| description | Release notes for Neatoo RemoteFactory v0.13.0 |
| parent | Release Notes |
| nav_order | 2 |
Release Date: 2026-02-18 NuGet: Neatoo.RemoteFactory 0.13.0
Adds support for [Execute] methods on non-static [Factory] classes, enabling orchestration logic to be co-located with the aggregate it operates on. Execute methods appear on the same factory interface as Create, Fetch, and Save.
public static methods decorated with [Execute] on a [Factory] class generate a method on the factory interface. This is ideal for operations that create or return an instance of the containing type, such as create-or-fetch patterns:
public interface IConsultation
{
long PatientId { get; }
string Status { get; }
}
[Factory]
public partial class Consultation : IConsultation
{
public long PatientId { get; set; }
public string Status { get; set; } = string.Empty;
[Remote, Create]
public Task CreateAcute(long patientId, [Service] IRepository repo) { ... }
[Remote, Fetch]
public Task<bool> FetchActive(long patientId, [Service] IRepository repo) { ... }
[Remote, Execute]
public static async Task<IConsultation> StartForPatient(
long patientId,
[Service] IConsultationFactory factory,
[Service] IRepository repo)
{
var existing = await factory.FetchActive(patientId);
if (existing != null) return existing;
return await factory.CreateAcute(patientId);
}
}Generated factory interface:
public interface IConsultationFactory
{
Task<IConsultation> CreateAcute(long patientId, CancellationToken ct = default);
Task<IConsultation?> FetchActive(long patientId, CancellationToken ct = default);
Task<IConsultation> StartForPatient(long patientId, CancellationToken ct = default);
}Key characteristics:
- Methods must be
public static(unlike static factory Execute which usesprivate static) - Return type must be the containing type or its matching
I{ClassName}interface - When a matching interface exists, all factory methods return the interface type
[Service]parameters are injected server-side; non-service parameters become factory method parameters
None
None
3768f4f- feat: support [Execute] static methods on non-static [Factory] classes94b3b9e- test: add [Execute] tests for class factories with matching interface return type5281f8d- test: make interface return types the norm in class Execute testsea67a4e- docs: document [Execute] on class factory in docs and skill7459961- docs: use MarkdownSnippets for class factory Execute code samples