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); }
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); }