Fluent API
Faster development thanks to the Fluent API of Umbraco Commerce.
Writing fluently
await _uowProvider.ExecuteAsync(async (uow) =>
{
// Fetch the currency
var currency = await _currencyService.GetCurrencyAsync(currencyId);
// Convert the currency into it's Writable form
var writableCurrency = await currency.AsWritableAsync(uow);
// Perform the write operation
await writableCurrency.SetNameAsync("New Name");
// Persist the changes to the database
await _currencyService.SaveCurrencyAsync(currency);
// Close the transaction
uow.Complete();
});
Last updated
Was this helpful?