-
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
InMemory: System.NullReferenceException on FindAsync #16099
Comments
@samueleresca First, many thanks for trying preview 6. If you haven't seen it already, there is some good information in the preview announcement post about the changes that are happening to LINQ queries for EF Core 3.0. Preview 6 is the first release containing these changes, which means we are both expecting things to be broken, but at the same time very grateful for everyone who tries the release and generated feedback. As the blog posts says, LINQ queries to the in-memory database are currently not working for preview 6. Pinging @smitpatel for overall issue tracking this, or some more specific issue if appropriate. |
Hi @ajcvickers, sorry, I've totally missed the announcement part about EF Core, my fault :). Should I close the issue? |
@samueleresca I was attempting to thank you for filing the issue! I guess I need to change the my wording somewhat to make that clear. |
I've the same issue with: <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.0-preview7.19362.6" /> |
Note: not fixed for cases where the entity is not found. ( |
Not fixed for me :
The code is : /// <summary>
/// Finds scheme definition by scheme asynchronous.
/// </summary>
/// <param name="scheme">The scheme.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>
/// An instance of TSchemeDefinition or null.
/// </returns>
/// <exception cref="System.ArgumentException">Parameter {nameof(scheme)}</exception>
public virtual async Task<TSchemeDefinition> FindBySchemeAsync(string scheme, CancellationToken cancellationToken = default(CancellationToken))
{
if (string.IsNullOrWhiteSpace(scheme))
{
throw new ArgumentException($"Parameter {nameof(scheme)} cannor be null or empty");
}
cancellationToken.ThrowIfCancellationRequested();
var definition = await _context.FindAsync<TSchemeDefinition>(new[] { scheme }, cancellationToken);
if (definition != null)
{
Deserialize(definition);
}
return definition;
} DynamicProviderStore on github You can run the test : Aguacongas.AspNetCore.Authentication.EntityFramework.Test.DynamicManagerTest.RemoveAsync_should_remove_handler using the develop branch |
@ajcvickers You should reopen |
@aguacongas This fix was not included in preview 8. Please try with the daily builds |
@ajcvickers thx, it's fixed in 3.0.0-preview9.* using daily build |
When I call the
FindAsync
method on anDbSet
using a no-existing id, I'm getting an exception. I'm expectingnull
.Steps to reproduce
EFCore.IssueSample (please refer to the
preview-6-null-ref-inmemory
branch)Please run:
Further technical details
EF Core version:
3.0.0-preview6.19304.10
Database Provider: Microsoft.EntityFrameworkCore.InMemory)
Operating system: macOS
IDE: VsCode
The text was updated successfully, but these errors were encountered: