Kind: Service
Source: Pams/Logic/Pams.CurrencyConverter/Pams.CurrencyConverter.csproj (line 1)
Part of: Pams
NuGet package dependency
The Pams.CurrencyConverter project declares NuGet package dependencies in a legacy-format .csproj file. Package restore resolves the libraries required by the currency conversion service before the application is built or run.
Diagram
mermaidsequenceDiagram participant Client as Client Application participant Service as Currency Converter Service participant Packages as NuGet Dependencies Client->>Service: Request currency conversion Service->>Packages: Call dependency APIs Packages-->>Service: Return conversion data Service-->>Client: Return converted amount
Usage
tstype ConversionResult = {
amount: number;
currency: string;
};
async function convertCurrency(
amount: number,
from: string,
to: string,
): Promise<ConversionResult> {
const response = await fetch("/api/currency-converter/convert", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ amount, from, to }),
});
if (!response.ok) {
throw new Error("Currency conversion request failed");
}
return response.json();
}
const result = await convertCurrency(100, "USD", "EUR");
console.log(`${result.amount} ${result.currency}`);
AI Coding Instructions
- Keep NuGet package references compatible with the legacy
.csprojformat used byPams.CurrencyConverter. - Restore packages before building or testing changes that depend on package-provided types or APIs.
- Check package version compatibility with the target framework before adding or updating dependencies.
- Keep conversion request and response contracts aligned between client code and the currency converter service.
Was this page helpful?