예제 #1
0
        public void GetTranslation()
        {
            using (CultureHelper.Use("en-us"))
            {
                var translation = _multiLingualObjectManager.GetTranslation <MultiLingualBook, MultiLingualBookTranslation>(_book);

                translation.Name.ShouldBe("C# in Depth");
            }
        }
예제 #2
0
        public MultiLingualBookDto Map(MultiLingualBook source)
        {
            var translation =
                _multiLingualObjectManager.GetTranslation <MultiLingualBook, MultiLingualBookTranslation>(source);

            return(new MultiLingualBookDto
            {
                Price = source.Price,
                Id = source.Id,
                Name = translation?.Name
            });
        }