public async Task <OperationResult> Convert([FromRoute] int userId, [FromBody] ConvertForm form) { if (form.Amount <= 0) { return(new OperationResult(false, Constants.AmountShouldBePositive)); } return(await walletService.Convert(userId, form.Amount, form.FromCurrency, form.ToCurrency)); }
public override void InitRemotable(DextopRemote remote, DextopConfig config) { base.InitRemotable(remote, config); Remote.AddStore("model", Load); Remote.AddStore("history", LoadHistory); Remote.AddLookupData("Currency", CurrencyDataProvider.GetCurrencyList().Rates.Select(a => new Object[] { a.ISOCode, String.Format("{0} ({1})", a.Currency, a.ISOCode) }).ToArray()); config["convertData"] = new ConvertForm { Amount = 100, Currency = "EUR" }; }