Ejemplo n.º 1
0
        private List <BookCopyViewModel> ConvertDataToViewModels(List <BookCopyData> domainModels)
        {
            var viewModels = new List <BookCopyViewModel>();

            foreach (var item in domainModels)
            {
                BookCopyViewModelBuilder builder = BuilderResolverService.Get <BookCopyViewModelBuilder, BookCopyData>(item);
                Constructor.ConstructViewModelData(builder);
                viewModels.Add(builder.GetViewModel());
            }

            return(viewModels);
        }
Ejemplo n.º 2
0
        public BookCopyViewModel GetCopy(int?bookCopyId)
        {
            var viewModel = new BookCopyViewModel();

            if (bookCopyId.HasValue)
            {
                BookCopyData             domainModel = BookCopyRepository.GetDataById(bookCopyId.Value);
                BookCopyViewModelBuilder builder     = BuilderResolverService.Get <BookCopyViewModelBuilder, BookCopyData>(domainModel);
                Constructor.ConstructViewModelData(builder);
                viewModel = builder.GetViewModel();
            }

            return(viewModel);
        }