public async Task <IActionResult> Index() { var publishers = await publisherLookupDataService.GetPublisherLookupAsync(nameof(PublishersViewModel)); var vm = new PublishersViewModel() { Publishers = publishers }; return(View(vm)); }
public PublishersViewModelTests() { eventAggregatorMock = new Mock <IEventAggregator>(); publisherLookupServiceMock = new Mock <IPublisherLookupDataService>(); publisherLookupServiceMock.Setup(dp => dp.GetPublisherLookupAsync(nameof(PublisherDetailViewModel))) .ReturnsAsync(new List <LookupItem> { new LookupItem { Id = Guid.NewGuid(), DisplayMember = "Publisher 1" }, new LookupItem { Id = Guid.NewGuid(), DisplayMember = "The Second Publisher" } }); viewModel = new PublishersViewModel(eventAggregatorMock.Object, publisherLookupServiceMock.Object); }
public PublishersPage() { InitializeComponent(); DataContext = new PublishersViewModel(); }