Skip to content

Getting Started

<PackageReference Include="Pragmatic.Attachments" />

Typical companion packages:

<PackageReference Include="Pragmatic.Persistence" />
<PackageReference Include="Pragmatic.Storage" />
<PackageReference Include="Pragmatic.Endpoints" />
[Entity<Guid>]
[Resource("invoices")]
[HasAttachments(MaxPerEntity = 10, AllowedExtensions = ".pdf,.png")]
public partial class Invoice
{
public string Number { get; set; } = "";
}
await PragmaticApp.RunAsync(args, builder =>
{
builder.UseStorage(sp => new LocalDiskFileStorage(
"wwwroot",
sp.GetRequiredService<ILogger<LocalDiskFileStorage>>()));
});

After build, the consuming boundary gets attachment actions and endpoints for upload, download, and delete under the parent resource.