sort the column in the table
Hi I have Code, Field and Status Fields in almost all of my tables. Therefore, instead of writing for each entity that I will create these 3 fields, I created a code as follows.
public class BaseEntity : FullAuditedAggregateRoot
However, when the Database is Generated, the image is as follows.
Code Named Situation ID ExtraProperties ConcurrencyStamp CreationTime creatorId My lastmodificationti LastModifierId IsDeleted DeleterId DeletionTime
However, I want the Id column to be at the top
How can I do it the way I want.
Have you tried starting with Order=2
public class BaseEntity : FullAuditedAggregateRoot { [Column(Order = 2)] public string Code { get; set; } [Column(Order = 3)] public string Named { get; set; } [Column(Order = 4)] public bool Situation { get; set; } }
Alternatively you could edit the migration code created after you have used the add-migration command
Don
This issue does not appear to be related to ABP.
You can still use @DonVliet's answer or the fluent API.
modelBuilder.Entity<Employee>(x =>
{
x.Property(b => b.Id)
.HasColumnOrder(0);
x.Property(b => b.FirstName)
.HasColumnOrder(1);
x.Property(b => b.LastName)
.HasColumnOrder(2);
});
Note: You can use stackoverflow for such questions specific to your application.
Thank you.