首页 > 解决方案 > 如何使用代码优先将 Id 降序保存在数据库中?

问题描述

我想使用代码优先将 Id 保存为表中的降序

但是我不知道怎么做

我的模型:

public class AccountChangeHistory
    {
        [Key]
        public int Id { get; set; }
        public int CustomerId { get; set; }
        public string Action { get; set; }
        public DateTime DateTime { get; set; }


        [ForeignKey("CustomerId")]
        public virtual Customer Customer { get; set; }
    }

标签: sql-serveref-code-firstentity-framework-corecode-first

解决方案


推荐阅读