Fixed issue with filters causing null ref when casting
This commit is contained in:
Родитель
7169a4a4b3
Коммит
051c083811
|
@ -90,7 +90,7 @@
|
|||
{
|
||||
var state = Grid.GetState();
|
||||
// clear TransactionDate filters
|
||||
state.FilterDescriptors = state.FilterDescriptors.Where(f => (f as FilterDescriptor).Member != "TransactionDate").ToList();
|
||||
state.FilterDescriptors = state.FilterDescriptors.Where(f => (f as FilterDescriptor)?.Member != "TransactionDate").ToList();
|
||||
// assign new TransactionDate filters
|
||||
state.FilterDescriptors.Add(StartFilter());
|
||||
state.FilterDescriptors.Add(EndFilter());
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using BlazingCoffee.Shared;
|
||||
using BlazingCoffee.Shared.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -24,7 +25,7 @@ namespace BlazingCoffee.Server.Controllers
|
|||
[HttpPost]
|
||||
public async Task<ActionResult<DataEnvelope<Sale>>> GetSales([FromBody]DataSourceRequest request)
|
||||
{
|
||||
var result = await _context.Sales.ToDataSourceResultAsync(request);
|
||||
DataSourceResult result = await _context.Sales.ToDataSourceResultAsync(request);
|
||||
var data = new DataEnvelope<Sale>
|
||||
{
|
||||
CurrentPageData = result.Data.OfType<Sale>().ToList(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче