You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello,
If I set the value in model LeftThumb (0) the value is saved in the database RightIndexFinger (6) because the entity framework considers the default value is 0 so the value will be RightIndexFinger (6) in (.HasDefaultValue(Fingers.RightIndexFinger)).
The issue was solved by setting LeftThumb=1 but is this issue or its normal behavior? EntityFramework6 c# .netcore
` public enum Fingers
{
LeftThumb,
LeftIndexFinger,
LeftMiddle,
LeftRingFinger,
LeftPinky,
RightThumb,
RightIndexFinger,
RightMiddle,
RightRingFinger,
RightPinky
}
public class EmployeeFingerPrint
{
public Guid EmployeeFingerPrintGuid { set; get; }
public Guid EmployeeGuid { set; get; }
public Fingers FingerNumber { set; get; }
}
public class EmployeeFingerPrintConfiguration : IEntityTypeConfiguration<EmployeeFingerPrint>
{
public void Configure(EntityTypeBuilder<EmployeeFingerPrint> builder)
{
builder.ToTable("EmployeeFingerPrint").HasKey(k => k.EmployeeFingerPrintGuid);
builder.Property(p => p.FingerNumber).HasColumnType("tinyint")
.HasDefaultValue(Fingers.RightIndexFinger).IsRequired();
}
}`
The text was updated successfully, but these errors were encountered:
hello,
If I set the value in model LeftThumb (0) the value is saved in the database RightIndexFinger (6) because the entity framework considers the default value is 0 so the value will be RightIndexFinger (6) in (.HasDefaultValue(Fingers.RightIndexFinger)).
The issue was solved by setting LeftThumb=1 but is this issue or its normal behavior?
EntityFramework6 c# .netcore
The text was updated successfully, but these errors were encountered: