private async Task <OptionListViewDto> GetFirstMatchingOptionListByKey(GetOptionListDto input) { if (string.IsNullOrEmpty(input.Key)) { return(null); } return(await _optionListAppService.GetListByKey(input)); }
public async Task TestGetAllLists(string filter, int expectedCount) { //arrange var input = new GetOptionListDto() { Filter = filter }; await UsingDbContextAsync(async context => { var lists = await context.OptionLists.Where(e => CultureInfo.InvariantCulture.CompareInfo.IndexOf(e.DisplayName, filter, CompareOptions.IgnoreCase) >= 0).ToListAsync(); lists.ShouldNotBeNull(); lists.Count.ShouldBe(expectedCount); }); }