示例#1
0
        public UserViewModel GetUserViewModel(int aUserId)
        {
            UserViewModel lUserViewModel = new UserViewModel();
            User          lUser          = Context.GetContext().User.FirstOrDefault(a => a.UserId == aUserId);

            if (lUser != null)
            {
                Copy.CopyPropertyValues(lUser, lUserViewModel);
            }
            return(lUserViewModel);
        }
示例#2
0
        public BookViewModel GetBookViewModel(int bookId)
        {
            BookViewModel bookViewModel = new BookViewModel();
            Book          bookEntity    = Context.GetContext().Book.FirstOrDefault(a => a.BookId == bookId);

            if (bookEntity != null)
            {
                Copy.CopyPropertyValues(bookEntity, bookViewModel);
            }

            bookViewModel.DictBookGenreList = GetDictBookGenreList();

            return(bookViewModel);
        }