public LocaleRepositoryUnitTest() { _locales = new LocaleRepository ( new EnvironmentLocaleFactory() ); }
public static void MoveLocaleInRepository(this ILocaleRepository repository, string oldLocaleKey, string newLocaleKey) { if (!repository.Exists(oldLocaleKey)) { return; } var localeData = repository.Get(oldLocaleKey); repository.Delete(oldLocaleKey); repository.Create(newLocaleKey, localeData); }
public CurrencyRepositoryUnitTest() { _currencies = new CurrencyRepository ( new EnvironmentCurrencyFactory() ); _locales = new LocaleRepository ( new EnvironmentLocaleFactory() ); }
public FilesService( IFilesRepository filesRepository, IGlossaryRepository glossaryRepository, ILocaleRepository localeRepository, IFilesPackagesRepository filesPackagesRepository, SettingsModel settings ) { this._filesRepository = filesRepository; this._glossaryRepository = glossaryRepository; this._localeRepository = localeRepository; this._filesPackagesRepository = filesPackagesRepository; this._settings = settings; }
public CurrencyFormatterUnitTest() { _currencyRepository = new CurrencyRepository(new EnvironmentCurrencyFactory()); _localeRepository = new LocaleRepository(new EnvironmentLocaleFactory()); _locale = _localeRepository.GetLocale("pt-PT"); _currency = _currencyRepository.GetDefaultCurrency(_locale); _alternativeCurrency = _currencyRepository.GetCurrency("USD"); _currencyFormatter = new CurrencyFormatter(); _alternativeCurrencyNumberFormatInfo = (NumberFormatInfo)_locale.Culture.NumberFormat.Clone(); _alternativeCurrencyNumberFormatInfo.CurrencyDecimalDigits = _alternativeCurrency.Scale; _alternativeCurrencyNumberFormatInfo.CurrencySymbol = _alternativeCurrency.Symbol; }
public MessageRepositoryUnitTest() { _locales = new LocaleRepository ( new EnvironmentLocaleFactory() ); _messages = new MessageRepository ( new MachineObjectMessageFactory() ); _english = _locales.GetLocale("en-US"); _portuguese = _locales.GetLocale("pt-PT"); }
public GlobalizationContextUnitTest() { var guow = new GlobalizationUnitOfWork ( new CurrencyRepository(new EnvironmentCurrencyFactory()), new LocaleRepository(new EnvironmentLocaleFactory()), new MessageRepository(new MachineObjectMessageFactory()) ); _currencyRepository = guow.Currencies; _localeRepository = guow.Locales; _locale = guow.Locales.GetLocale("pt-PT"); _globalizationContext = guow.CreateContext("pt-PT", "default"); _alternativeCurrency = guow.Currencies.GetCurrency("USD"); _alternativeCurrencyNumberFormatInfo = (NumberFormatInfo)_locale.Culture.NumberFormat.Clone(); _alternativeCurrencyNumberFormatInfo.CurrencyDecimalDigits = _alternativeCurrency.Scale; _alternativeCurrencyNumberFormatInfo.CurrencySymbol = _alternativeCurrency.Symbol; }
public static bool Delete(this ILocaleRepository repository, string id) { return(repository.Query(new DeleteLocaleQuery(id))); }
public static IEnumerable <string> GetAll(this ILocaleRepository repository, params string[] ids) { return(repository.Query(new GetAllLocalesQuery(ids))); }
public static string Get(this ILocaleRepository repository, string id) { return(repository.Query(new GetLocaleQuery(id))); }
public void AddRepository(ILocaleRepository repository) { LocaleDatasets.Add(repository.LocaleCode, repository); }
public static string Create(this ILocaleRepository repository, string text, string id) { return(repository.Query(new CreateLocaleQuery(text, id))); }
public static void UpdateLocale <T>(this T localeEntity, string newAssetCode, ILocaleRepository repository) where T : IHasLocaleDescription { var oldNameLocaleId = localeEntity.NameLocaleId; var oldDescriptionLocaleId = localeEntity.DescriptionLocaleId; localeEntity.GenerateLocaleCodes(newAssetCode); MoveLocaleInRepository(repository, oldNameLocaleId, localeEntity.NameLocaleId); MoveLocaleInRepository(repository, oldDescriptionLocaleId, localeEntity.DescriptionLocaleId); }
/// <summary> /// Creates a new globalization unit of work. /// </summary> /// <param name="currencies"> /// The currency repository. /// </param> /// <param name="locales"> /// The locale repository. /// </param> /// <param name="messages"> /// The message repository. /// </param> public GlobalizationUnitOfWork(ICurrencyRepository currencies, ILocaleRepository locales, IMessageRepository messages) { Currencies = currencies ?? throw new ArgumentNullException(nameof(currencies)); Locales = locales ?? throw new ArgumentNullException(nameof(locales)); Messages = messages ?? throw new ArgumentNullException(nameof(messages)); }
public static bool Exists(this ILocaleRepository repository, string id) { return(repository.Query(new LocaleExistsQuery(id))); }
public static LocaleDataset GetDataset(this ILocaleRepository repository, string locale) { return(repository.Query(new GetLocaleDatasetQuery(locale))); }
public DataImportController(ILocaleRepository localeRepository, FromExcel fromExcel, IHubContext <DataImportHub> hubContext) { this._localeRepository = localeRepository; this._fromExcel = fromExcel; this._hubContext = hubContext; }
public static string GetKeyFor(this ILocaleRepository repository, string typeKey, int typeValue) { return(DefaultLocaleRepository.GetKeyFor(typeKey, typeValue)); }
public LocaleCacheRepository(ILocaleRepository repository, IMemoryCache cache, ICachedUnitOfWork unitOfWork) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _cache = cache ?? throw new ArgumentNullException(nameof(cache)); _unitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); }