public async Task <GetWidgetsByBatchNumberAndCreationDateResponse> Handle(GetWidgetsByBatchNumberAndCreationDate query) { var widgets = await _context.Widgets .Where(widget => widget.BatchNumber == query.BatchNumber) .Where(widget => widget.CreatedOn == query.CreationDate) .ToListAsync(); return(_widgetFactory.BatchNumberAndCreationDateResponse(widgets)); }
public async Task <GetWidgetsByBatchNumberAndCreationDateResponse> Handle(GetWidgetsByBatchNumberAndCreationDate query) { var widgets = await _widgetRepository.SearchBatchNumberOnDate(query.BatchNumber, query.CreationDate); return(_widgetFactory.BatchNumberAndCreationDateResponse(widgets)); }