Esempio n. 1
0
        public CurrencyModel GetPreferredCurrency()
        {
            var preferencesRepository = repositoryFactory.CreatePreferencesRepository();
            var user = userService.GetAuthenticatedUser();
            var preferredCurrency  = preferencesRepository.FirstOrDefault(x => x.UserId.Equals(user.Id) && x.Key.Equals(PreferredCurrency));
            var currencyRepository = repositoryFactory.CreateCurrencyRepository();
            var currency           = currencyRepository.FirstOrDefault(x => x.Name.Equals(preferredCurrency.Value));

            return(currencyMapper.ToModel(currency));
        }
Esempio n. 2
0
        public Currency GetCurrency(string name)
        {
            var currencyRepository = repositoryFactory.CreateCurrencyRepository();

            return(currencyRepository.FirstOrDefault(x => x.Name.Equals(name)));
        }