Repository navigation
Conversation
The ContosoUniversity cu-final sample targets netcoreapp2.2 (EF Core 2.2), where FromSqlRaw and ExecuteSqlRawAsync do not exist (they were introduced in EF Core 3.0). This was causing CS1061 build errors. Reverting to FromSql and ExecuteSqlCommandAsync to match the EF Core 2.2 APIs and restore compilation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes build failures in
aspnetcore/data/ef-mvc/intro/samples/cu-final/ContosoUniversity.csproj.The
cu-finalsample targetsnetcoreapp2.2(EF Core 2.2). In prior PRs (#23398 and #23401),FromSqlandExecuteSqlCommandAsyncwere updated to EF Core 3.0+ APIs (FromSqlRawandExecuteSqlRawAsync), which do not exist in EF Core 2.2 and resulted inCS1061compiler errors when building the sample:error CS1061: 'DbSet<Department>' does not contain a definition for 'FromSqlRaw'error CS1061: 'DatabaseFacade' does not contain a definition for 'ExecuteSqlRawAsync'This PR restores
FromSqlandExecuteSqlCommandAsyncto match the EF Core 2.2 APIs and allow the sample to build cleanly.