Beispiel #1
0
        public async Task GetTranslationAsync()
        {
            using (CultureHelper.Use("en-us"))
            {
                var translation = await _multiLingualObjectManager.GetTranslationAsync <MultiLingualBook, MultiLingualBookTranslation>(_book);

                translation.Name.ShouldBe("C# in Depth");
            }
        }
        public void Process(TSource source, TDestination destination, ResolutionContext context)
        {
            var translation = AsyncHelper.RunSync(() => _multiLingualObjectManager.GetTranslationAsync <TSource, TTranslation>(source));

            if (translation != null)
            {
                context.Mapper.Map(translation, destination);
            }
        }