-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query: "Null TypeMapping in Sql Tree" when projecting a null value DTO #15862
Comments
FYI I just hit this trying to use preview6 in the Conference Planner workshop app. Offending query is at https://github.com/dotnet-presentations/aspnetcore-app-workshop/blob/3.0/src/BackEnd/Controllers/SessionsController.cs#L27 and includes a call to helper method at https://github.com/dotnet-presentations/aspnetcore-app-workshop/blob/3.0/src/BackEnd/Infrastructure/EntityExtensions.cs#L7 The error shown at first is simply a default [HttpGet]
public async Task<ActionResult<List<SessionResponse>>> Get()
{
var sessions = await _db.Sessions.AsNoTracking()
.Include(s => s.Track)
.Include(s => s.SessionSpeakers)
.ThenInclude(ss => ss.Speaker)
.Select(session => new ConferenceDTO.SessionResponse
{
Id = session.Id,
Title = session.Title,
//StartTime = session.StartTime,
//EndTime = session.EndTime,
// Speakers = session.SessionSpeakers?
//.Select(ss => new ConferenceDTO.Speaker
//{
// Id = ss.SpeakerId,
// Name = ss.Speaker.Name
//})
// .ToList(),
//TrackId = session.TrackId,
//Track = new ConferenceDTO.Track
//{
// //Id = session?.TrackId ?? 0,
// //Name = session.Track?.Name
//},
Abstract = session.Abstract
})
.ToListAsync();
return sessions;
} |
Any update on this one? |
This exception is also thrown when mapping models with ternary operator.
|
Covers EFCore.Specs.Tests Query folder Resolves #8366 Resolves #8582 Resolves #8722 Resolves #9007 Resolves #9254 Resolves #12574 Resolves #12579 Resolves #12598 Resolves #12786 Resolves #12787 Resolves #12794 Resolves #12806 Resolves #12827 Resolves #12873 Resolves #14900 Resolves #15862 Resolves #16157 Resolves #17240 Resolves #17243 Close #12889 Close #17243
Covers EFCore.Specs.Tests Query folder Resolves #8366 Resolves #8582 Resolves #8722 Resolves #9007 Resolves #9254 Resolves #12574 Resolves #12579 Resolves #12598 Resolves #12786 Resolves #12787 Resolves #12794 Resolves #12806 Resolves #12827 Resolves #12873 Resolves #14900 Resolves #15862 Resolves #16157 Resolves #17240 Close #12889 Close #17243
Covers EFCore.Specs.Tests Query folder Resolves #8366 Resolves #8582 Resolves #8722 Resolves #9007 Resolves #9254 Resolves #12574 Resolves #12579 Resolves #12598 Resolves #12786 Resolves #12787 Resolves #12794 Resolves #12806 Resolves #12827 Resolves #12873 Resolves #14900 Resolves #15862 Resolves #16157 Resolves #17240 Close #12889 Close #17243
query:
exception:
The text was updated successfully, but these errors were encountered: