-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add parameterless overload of HasDefaultValueSql #7872
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
Milestone
Comments
Design meeting notes:
|
ajcvickers
added a commit
that referenced
this issue
Jul 2, 2017
… passing null or no arguments Issues #8015, #7872 Setting null or passing no args to the fluent API now sets a sentinel indicating that the method has been called rather than removing the annotation. In most cases the result is functionally equivalent, but in some cases it will now force non-identity value generation without the need to specify what is actually happening in the database.
ajcvickers
added a commit
that referenced
this issue
Jul 3, 2017
… passing null or no arguments Issues #8015, #7872 Setting null or passing no args to the fluent API now sets a sentinel indicating that the method has been called rather than removing the annotation. In most cases the result is functionally equivalent, but in some cases it will now force non-identity value generation without the need to specify what is actually happening in the database.
ajcvickers
added a commit
that referenced
this issue
Jul 3, 2017
… passing null or no arguments Issues #8015, #7872 Setting null or passing no args to the fluent API now sets a sentinel indicating that the method has been called rather than removing the annotation. In most cases the result is functionally equivalent, but in some cases it will now force non-identity value generation without the need to specify what is actually happening in the database.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-enhancement
HasDefaultValueSql does two things:
If you are managing the database outside of EF, then the first point doesn't apply, but you still need to pass in some string, even though this is then ignored by the update pipeline. This has always seemed a bit clunky. Instead we could allow a parameterless call to be made:
I think this looks pretty nice in the fluent API and is less clunkly than passing some random string.
If this is used with Migrations/EnsureCreated, it could throw, or maybe it could just default to using null for the default value.
/cc #4189
The text was updated successfully, but these errors were encountered: