Skip to content

Commit

Permalink
Correct nullability annotation for ReferenceEntry (#25591)
Browse files Browse the repository at this point in the history
Fixes #24659
  • Loading branch information
roji authored Aug 19, 2021
1 parent 5da86b8 commit c833579
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/EFCore/ChangeTracking/EntityEntry`.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public virtual PropertyEntry<TEntity, TProperty> Property<TProperty>(
/// given navigation property.
/// </returns>
public virtual ReferenceEntry<TEntity, TProperty> Reference<TProperty>(
Expression<Func<TEntity, TProperty>> propertyExpression)
Expression<Func<TEntity, TProperty?>> propertyExpression)
where TProperty : class
{
Check.NotNull(propertyExpression, nameof(propertyExpression));
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore/ChangeTracking/ReferenceEntry`.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ReferenceEntry(InternalEntityEntry internalEntry, INavigation navigation)
/// the change tracker is aware of the change and <see cref="ChangeTracker.DetectChanges" /> is not required
/// for the context to detect the change.
/// </summary>
public new virtual TProperty CurrentValue
public new virtual TProperty? CurrentValue
{
get => this.GetInfrastructure().GetCurrentValue<TProperty>(Metadata);
set => base.CurrentValue = value;
Expand Down

0 comments on commit c833579

Please sign in to comment.