Я пытаюсь заставить следующий код для работы, но он дает мне ошибку: < /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
Как мне получить быстрый грид с несколькими таблицами для работы без ошибок? ⇐ C#
Место общения программистов C#
1758268245
Anonymous
Я пытаюсь заставить следующий код для работы, но он дает мне ошибку: < /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
[url=boards/create]Create New[/url]
@if (result == null)
{
Loading....
}else
{
BoardView.Code" />
[url=@($]Edit[/url] |
[url=@($]Details[/url] |
[url=@($]Delete[/url]
}
@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.
Подробнее здесь: [url]https://stackoverflow.com/questions/78042655/how-do-i-get-quickgrid-with-multiple-tables-to-work-without-erroring[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия