Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Build fails - "An unknown error has occurred - check the processing queue for more information"
Awwan
#1 Posted : Sunday, August 22, 2021 4:14:36 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/23/2020(UTC)
Posts: 1
Location: Sweden

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
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.026 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download