I had a curious case of the Entity Framework Migration and Database Generated Grid Column.
public class error logs {public mess error log ID {get; Set; } Public Int64 sequence {get; Set; }} This is the class in which there are two identifying columns. There is a grid and the second sequence, although in this case I have configured the unit structure based on fluent configuration in the OnModelCreating method.
I have defined the conference for the primary here . As
builder.Properties (). Where (x = & gt; x.Name == x.DeclaringType + "Id"). Configure (config = & gt; {config.IsKey () HasDatabaseGeneratedOption (DatabaseGeneratedOption.Identity);}); (X = & gt; x.Name == "Sequence" & amp; X. Property Type == Type (Int64)). Configure (x = & gt; {x.HasDatabaseGeneratedOption (DatabaseGeneratedOption.Identity);}); The interesting thing is now that when I generate a migration, the IT column shows its identity but the Migration file does not have an identity option on the Guid column. But accordingly, on which I mentioned the code on the OnModelCreating method should generate a migration file on this ID code on the Guid column. Tell me why is this happening?
Another Note ErrorLogs & gt; If I use EntityTypeConfiguration & lt and provide them as builder.Configurations.Add (New ErrorLogsMappingMap ()); then able to create identification columns for GUID with itself. But in the case of a global fluent unit configuration conference
The migration file is generated such as:
CreateTable ("REMS.ErrorLogs", c = & gt; new { ErrorLogsId = c.Guid (nullable: false), sequence = c. Long (measurable: false, identity: true)}). (T => T. Ellol Lodge ID); but the file should actually have it ErrorLogsId = c.Guid (nullable: false, identity: true),
Comments
Post a Comment