@using Groceries.Data; @using Microsoft.EntityFrameworkCore; @model Transaction @inject AppDbContext dbContext @{ ViewBag.Title = "New Transaction"; var store = await dbContext.Stores .Where(store => store.Id == Model.StoreId) .Select(store => string.Concat(store.Retailer!.Name, " ", store.Name)) .SingleAsync(); var itemIds = Model.Items.Select(item => item.ItemId); var items = await dbContext.Items .Where(item => itemIds.Contains(item.Id)) .Select(item => new { item.Id, Name = string.Concat(item.Brand, " ", item.Name) }) .ToListAsync(); }