Hi,
Had a weird issue yesterday. This line of code made the build fail in nCrunch. Initially I had no errors, but then got:
"An unknown error has occurred - check the processing queue for more information"
var oldestPriceByDate = await _dataverse.in_Price.AsQueryable()
.Join(_dataverse.in_Instrument.AsQueryable(), price =>
price.in_Instrument, instrument => instrument.in_InstrumentId, (price,
instrument) =>
new { price, instrument })
.Where(x => x.price.in_PriceEvent == priceEventId && x.instrument.in_InstrumentType == (int)in_instrumenttype.Currency)
.OrderBy(x => x.price.in_Date)
.Select(x => x.price)
.FirstOrDefaultAsync();
Once narrowed down the fix was to explicitly name the properties in the anonymous class:
var oldestPriceByDate = await _dataverse.in_Price.AsQueryable()
.Join(_dataverse.in_Instrument.AsQueryable(), price => price.in_Instrument, instrument => instrument.in_InstrumentId, (price, instrument) =>
new { Price = price, Instrument = instrument })
.Where(x => x.Price.in_PriceEvent == priceEventId && x.Instrument.in_InstrumentType == (int)in_instrumenttype.Currency)
.OrderBy(x => x.Price.in_Date)
.Select(x => x.Price)
.FirstOrDefaultAsync();
Using EF Core.
Peter