示例#1
0
        Task <string> IQueryHandler <GetCurrencySymbol, string> .HandleAsync(GetCurrencySymbol query)
        {
            if (storage.TryGetValue(query.UniqueCode, out Model model))
            {
                return(Task.FromResult(model.Symbol));
            }

            throw new CurrencyDoesNotExistException();
        }
示例#2
0
        async Task <string> IQueryHandler <GetCurrencySymbol, string> .HandleAsync(GetCurrencySymbol query)
        {
            await EnsureUserStorageAsync(query.UserKey);

            if (storage[query.UserKey].TryGetValue(query.UniqueCode, out Model model))
            {
                return(model.Symbol);
            }

            throw new CurrencyDoesNotExistException();
        }