MVC3 naming a column beginning with a number

前端 未结 3 918
野的像风
野的像风 2021-01-22 01:16

I am new to MVC3 C#. I need to have a column in the database called 3DSecureStatus for legacy purposes.

When I call the column this and insert in the applic

3条回答
  •  隐瞒了意图╮
    2021-01-22 01:47

    Use the Column attribute to specify the database column name

    [Column("3DSecureStatus")]
    public string ThreeDSecureStatus { get; set; }
    

    Or use fluent mapping like

    Property(x => x.ThreeDSecureStatus).HasColumnName("3DSecureStatus");
    

提交回复
热议问题