Я пытаюсь заставить следующий код для работы, но он дает мне ошибку: < /p>
Severity Code Description Project File Line Suppression State
Error (active) CS0411 The type arguments for method 'TypeInference.CreateQuickGrid_0_CaptureParameters(string, out string, IQueryable, out IQueryable)' cannot be inferred from the usage. Try specifying the type arguments explicitly. BlazorApp1 C:\Users\me\source\repos\BlazorApp1\BlazorApp1\Components\Pages\BoardPages\Index.razor 20
< /code>
@page "/boards"
@using Microsoft.AspNetCore.Components.QuickGrid
@inject BlazorApp1.Data.ApplicationDbContext DB
@using BlazorApp1.Data
Index
Index
Create New
@if (result == null)
{
Loading....
}else
{
BoardView.Code" />
Edit |
Details |
Delete
}
@code {
public class BoardView
{
public int BoardID { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public double LowestPrice { get; set; }
public string SupplierName { get; set; }
}
private IEnumerable? result; // Move this declaration outside any method or block
protected override async Task OnInitializedAsync()
{
var boardPrices = from board in DB.Board
join boardSupplier in DB.BoardSupplier on board.ID equals boardSupplier.Board.ID
join supplier in DB.Supplier on boardSupplier.Supplier.Id equals supplier.Id
group new { board, boardSupplier, supplier } by new { board.ID, board.Code, board.Name } into grouped
select new BoardView
{
BoardID = grouped.Key.ID,
Code = grouped.Key.Code,
Name = grouped.Key.Name,
LowestPrice = grouped.Min(x => x.boardSupplier.Price),
SupplierName = grouped.FirstOrDefault(x => x.boardSupplier.Price == grouped.Min(y => y.boardSupplier.Price)).supplier.Name
};
result = boardPrices.ToList();
}
}
< /code>
I have been trying for hours and no luck, I just want to be able to build custom data from multiple tables and display it in QuickGrid....
Jon
Expected it to work, as it has the correct class.
Подробнее здесь: https://stackoverflow.com/questions/780 ... t-erroring