Getting Started
1. Install the package
Section titled “1. Install the package”<PackageReference Include="Pragmatic.Attachments" />Typical companion packages:
<PackageReference Include="Pragmatic.Persistence" /><PackageReference Include="Pragmatic.Storage" /><PackageReference Include="Pragmatic.Endpoints" />2. Mark the entity
Section titled “2. Mark the entity”[Entity<Guid>][Resource("invoices")][HasAttachments(MaxPerEntity = 10, AllowedExtensions = ".pdf,.png")]public partial class Invoice{ public string Number { get; set; } = "";}3. Configure storage
Section titled “3. Configure storage”await PragmaticApp.RunAsync(args, builder =>{ builder.UseStorage(sp => new LocalDiskFileStorage( "wwwroot", sp.GetRequiredService<ILogger<LocalDiskFileStorage>>()));});4. Use the generated feature
Section titled “4. Use the generated feature”After build, the consuming boundary gets attachment actions and endpoints for upload, download, and delete under the parent resource.