Kind: Service
Source: Pams/Logic/Pams.Email/Pams.Email.csproj (line 1)
Part of: Pams
NuGet package dependency
Microsoft.Threading.Tasks.Extensions.Desktop is a NuGet package dependency declared by Pams.Email.csproj. It provides task-based asynchronous APIs required by the Pams.Email project when running on desktop .NET targets.
Diagram
mermaidsequenceDiagram participant App as Calling Application participant Email as Pams.Email participant Tasks as Microsoft.Threading.Tasks.Extensions.Desktop App->>Email: Send email request Email->>Tasks: Await asynchronous operation Tasks-->>Email: Task completion result Email-->>App: Email operation result
Usage
tsasync function sendEmail(message: {
to: string;
subject: string;
body: string;
}) {
const response = await fetch("/api/email/send", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(message),
});
if (!response.ok) {
throw new Error("Email request failed");
}
return response.json();
}
await sendEmail({
to: "user@example.com",
subject: "Status update",
body: "The requested email was sent.",
});
AI Coding Instructions
- Keep the package reference in
Pams.Email.csprojaligned with the desktop .NET target used by the project. - Use
asyncandawaitwhen calling email operations that return tasks. - Do not add this package to browser or TypeScript projects; it is consumed by the .NET email service.
- Check package compatibility before changing the project target framework or package version.
Was this page helpful?