-
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
RevEng: Pass in correct arguments to ScaffoldingTypeMapper #9094
Conversation
c26c940
to
6d3a4ab
Compare
@@ -67,7 +67,7 @@ public ScaffoldingTypeMapper([NotNull] IRelationalTypeMapper typeMapper) | |||
scaffoldUnicode = unicodeMapping.IsUnicode != stringMapping.IsUnicode ? (bool?)stringMapping.IsUnicode : null; | |||
|
|||
// Check for size | |||
var sizedMapping = TypeMapper.StringMapper.FindMapping(unicode: mapping.IsUnicode, keyOrIndex: keyOrIndex, maxLength: null); | |||
var sizedMapping = TypeMapper.StringMapper.FindMapping(mapping.IsUnicode, keyOrIndex, maxLength: null); | |||
scaffoldMaxLengh = sizedMapping.Size != stringMapping.Size ? stringMapping.Size : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're in the file maybe fix the typo at line 71: scaffoldMaxLength
is missing the t
.
6d3a4ab
to
61f1654
Compare
- Infer keyOrIndex & rowversion for DatabaseColumn - Flow ConcurrencyToken annotation from database model to generate ConcurrencyToken() - Generate IsRowVersion() for rowversion columns on SqlServer - Do not put name annotations for index/FK with default name - Add empty line at the end of DbContext to make it consistent with other generated code - Normalize timestamp/rowversion to rowversion on SqlServer
61f1654
to
2de6639
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -233,8 +233,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) | |||
|
|||
entity.Property(e => e.TimestampColumn) | |||
.HasColumnName("timestampColumn") | |||
.HasColumnType("timestamp") | |||
.ValueGeneratedOnAddOrUpdate(); | |||
.IsRowVersion(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -99,7 +99,7 @@ public partial class AllDataTypes | |||
public byte[] Varbinary123Column { get; set; } | |||
[Column("varbinaryMaxColumn")] | |||
public byte[] VarbinaryMaxColumn { get; set; } | |||
[Column("timestampColumn", TypeName = "timestamp")] | |||
[Column("timestampColumn")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Resolves #8697