Skip to content
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

Made it possible to use IEnumerable.Empty() in HasDefaultValue. #18240

Conversation

TobiasWolters
Copy link

Made it possible to use IEnumerable.Empty() in HasDefaultValue.

  • Also added a test for it.

Fixes #17780

@TobiasWolters
Copy link
Author

Please let me know if the bug should be fixed differently.

.Entity<Customer>()
.Property(c => c.Orders)
.HasDefaultValue(Enumerable.Empty<Order>());
}
Copy link
Member

@AndriySvyryd AndriySvyryd Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an assert to check the default value was set

Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add a test to ModelSnapshotSqlServerTest that uses a default value and a value conversion to ensure that the correct value is stored in the snapshot.

@AndriySvyryd AndriySvyryd removed the request for review from smitpatel October 16, 2019 18:00
@AndriySvyryd AndriySvyryd changed the base branch from release/3.1 to master November 6, 2019 22:24
@ajcvickers
Copy link
Contributor

Closing this for now since there has been no recent activity. To resurrect this for more work, please create a new PR re-based on current master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HasDefaultvalue() for interfaces/generics
3 participants